Skip to content

Commit 3dfead3

Browse files
committed
fix use of '-' directory in static files
Under windows, the test for - to prevent using the html directory for resolving static files did not work. Fixed as part of getting test suite to run under windows.
1 parent 95517d8 commit 3dfead3

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

CHANGES.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ Fixed:
124124
- Fix anydbm session/otks clear() method on windows when backed by
125125
dumbdbm. Also make anydbm detect the initialized database when
126126
using dumbdbm. (John Rouillard)
127-
127+
- Use of '-' directory in static_files config option under windows
128+
Python fixed.
128129

129130
Features:
130131

doc/upgrading.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,14 @@ If you have modified that template, you can follow the analysis in
367367
`issue2551320 <https://issues.roundup-tracker.org/issue2551320>`_
368368
to fix your template.
369369

370+
Fix static_files use of '-' directory (info)
371+
--------------------------------------------
372+
373+
Use of the '-' directory in ``static_files`` config.ini setting now
374+
works. So it will prevent access to the html directory when using
375+
``@@file/`` based url's.
376+
377+
370378
Bad Login Rate Limiting and Locking (info)
371379
------------------------------------------
372380

@@ -410,8 +418,8 @@ before changing your PostgreSQL configuration, try changing the pragma
410418
``10000``. In some cases this may be too high. See the `administration
411419
guide`_ for further details.
412420

413-
roundup-admin's History Command Produces Readable Output
414-
--------------------------------------------------------
421+
roundup-admin's History Command Produces Readable Output (info)
422+
---------------------------------------------------------------
415423

416424
The history command of roundup-admin used to print the raw journal
417425
data. In this release the default is to produce more human readable

roundup/cgi/client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1934,9 +1934,10 @@ def serve_static_file(self, file):
19341934

19351935
for p in prefix:
19361936
# if last element of STATIC_FILES ends with '/-',
1937-
# we failed to find the file and we should
1938-
# not look in TEMPLATES. So raise exception.
1939-
if dir_option == 'STATIC_FILES' and p[-2:] == '/-':
1937+
# or \- on windows, we failed to find the file
1938+
# and should not look in TEMPLATES. So raise exception.
1939+
if (dir_option == 'STATIC_FILES' and p[-1:] == '-' and
1940+
p[-2:-1] in ('/', '\\')):
19401941
raise NotFound(file)
19411942

19421943
# ensure the load doesn't try to poke outside

0 commit comments

Comments
 (0)