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
httprb changes URL encoding with requests #611
Comments
OK. I'm going to close this one since I was able to fix it by digging through the HTTP rb code for a while to figure out the internals and options some. Something like this will keep it from changing the path and bypasses the normalization in the path part of the URL. It may not hurt to document it in the readme as an advanced option or something.
|
@sfisher what was the resolution? |
The resolution is to change the URL normalizing as in the code sample above. My example was a foreign character that someone put in and there are two different ways in UTF-8 represent the same character. One is The NORMALIZER constant is more or less a copy/paste of the code I found in the http.rb gem but with 2 changes. 1) referenced HTTP:URI explicitly (since it was inside the class in the other code) and 2) changed Then to get it to work without normalizing you can say what normalizer you want to use (the default is to use the built-in one), but I'm setting it like Maybe some people will like normalization, but our systems have the value in one database and it will be the same as in a separate internal system, so all that normalization does is make the request fail and give us a 404 instead of a 200 response because the values no longer match up after normalization. |
My original encoded string in the URL is
javois%CC%8C_et_al_data.xls
but httprb changes%CC%8C
by replacing the s with%C5
and adding%A1
. This makes matching and downloads fail, but changing the encoding doesn't happen with other programs or libraries like curl or HTTParty.The differences in these strings.
The text was updated successfully, but these errors were encountered: