Welcome! Log In Create A New Profile

Advanced

Location: url does not encode spaces to %20

Posted by drmetal 
Location: url does not encode spaces to %20
April 22, 2010 05:12AM
I wrote a program to java that reads a website, and downloads some files.

When you click on download.php?id=id does some work and then redirects you to the download file. This website had another server and recently update to nginx.

Since then my program does not work as before. I have located the error to the Location: header

It seems that it doesn't encode the urls, and replace the spaces with "%20". Firefox does this automatically but java doesn't.
I don't know if this is considered as a bug, i am just mentioning it. The fix is 2 lines of code. Replace all spaces with %20

I found a way around that in java, in this page http://forums.sun.com/thread.jspa?threadID=5170856 where you can read about the "problem"

Thank you Nikos Glikis
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 275
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready