-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encode URL properly #531
Encode URL properly #531
Conversation
Question marks weren't encoded. It's better to use a library.
e638e59
to
98459aa
Compare
@Phu2 |
Did you issued However, i am not familiar with this nvm/npm stuff. You can probably do some configurations to have the right node version and the npm command available instantly, see eg. https://stackoverflow.com/questions/33874049/npm-not-found-when-using-nvm |
Thx for nvm reminder @Phu2! I totally overread that in the README: |
Deployed, but this doesn't fix the problem: I've also noted that the Maybe the problem lies in the redirection. |
The PHP parse-url function cannot be used to separate "URL path" and "URL query" because if an "?" is part of the path it would be nontheless identified as a query parameter. Explicitly stick to the last "?" seems to be safe in the context of wikimedia commmons at least.
At least the problem is fixed :) It was neccessary to preserve the query parameter. If this workaround here doesn't generates other problems we could go with it. |
@Phu2 can you have another look? |
It works 👍 I still don't understand why for example this work: This is the orginal url passed to imagesproxy.php: This is the resulting url modified in imagesproxy.php by your commits: Apart from the encoding of the colon in
I agree with this. The script works on the commandline and fails when is executed via web server. Already tried in
but this does not fix the problem. |
This image proxy keeps making problems which take some time to resolve. Maybe we did not choose the best solution for the problem after all? In the original issue #421, I linked to that PHP script. After @dr0i had tried to implement the image proxy with Apache conf for some time he switched to the script solution. Maybe there is a better solution available now, I could not find something with a cursory web search, though, but might not have used the best search terms... |
Deployed to poduction, closed. |
@Phu2 :
You got that from php So something is happening at the webserver or in the browser, it seems. |
No, i'm just echo'ing in my test script, see
Yeah, i suspect But i wonder why
didn't work in my testing. See:
|
Question marks weren't encoded. It's better to use a library.
Resolves hbz/lobid-gnd#408.