Closed yurj closed 1 year ago
Yes, the slash is the issue. Escaping the slash won't work (pallets/werkzeug#797), but as there's no further structure expected under "/subject/" it looks like using the
in https://rdamsc.bath.ac.uk/subject-index there's https://rdamsc.bath.ac.uk/subject/Information%2Flibrary%20standards which still does not work but changing %2F to / it works: https://rdamsc.bath.ac.uk/subject/Information/library%20standards.
I've made a local installation from the github code and it has the same problem.
This behaviour does not occur when running the native development server on Linux:
export FLASK_APP=rdamsc; venv/bin/flask --debug run
But you're right, it does exhibit under production Apache/WSGI, even though according to the Werkzeug issue linked above it shouldn't be possible for Flask to distinguish /
and %2F
. Looks like I will have to include some logic to force all platforms to behave identically.
Okay, this is my fault for not reading the Apache docs in full. By default Apache rejects all URLs with "%2F" in them with a 404.
If I understand correctly, to get the code to work as currently written, you would need the following in your Apache configuration:
AllowEncodedSlashes On
(This will convert "%2F" to "/" and is the same behaviour as the built-in development/mock testing server).
But I've added a line in the /subjects/
route that allows %252F
in the URL as well, and also what I would prefer the Apache configuration to be:
AllowEncodedSlashes NoDecode
Hi!
in the "Browse by subject", if I click on "Information/library standards" (https://rdamsc.bath.ac.uk/subject/Information/library%20standards) I get 404 Not Found. I think because of the '/' in the subject name.