Why does a percentage sign cause Bad Request?
Why does a percentage sign cause Bad Request?
Author
Discussion

jesusbuiltmycar

Original Poster:

5,127 posts

283 months

Monday 24th August 2009
quotequote all
With my browser if a topic ghas a % sign in the title I get a bad request whenever I click on the link. Why is this and how can I sort it out? I am using IE 7 - does it need to be upgraded?

Xenocide

4,286 posts

237 months

Monday 24th August 2009
quotequote all
It's because % is used to start a special charecter. For example %20 is a space in a urlencoded string. If that's a bit techy for you, look at a topic that has a space in the title, look click on it and look in the address bar. You should(!) see that spaces are changed to %20.

If a topic has a % in it and it isn't "escaped", then the server expects the following charecters to tell it what the special charecter is, if there isn't any then it's not a valid url, and fails.

Try it, change a %20 to %%"12312 or something, should break it nicley smile.

Xenocide

4,286 posts

237 months

Monday 24th August 2009
quotequote all
Xenocide said:
It's because % is used to start a special charecter. For example %20 is a space in a urlencoded string. If that's a bit techy for you, look at a topic that has a space in the title, look click on it and look in the address bar. You should(!) see that spaces are changed to %20.

If a topic has a % in it and it isn't "escaped", then the server expects the following charecters to tell it what the special charecter is, if there isn't any then it's not a valid url, and fails.

Try it, change a %20 to %%"12312 or something, should break it nicley smile.
hmm that doesn't work. No idea then. haha

jesusbuiltmycar

Original Poster:

5,127 posts

283 months

Monday 24th August 2009
quotequote all
No idea how to escape the % sign? Regex usually uses a '\', but that does not work with URLs....

tossbag

1,590 posts

235 months

Monday 24th August 2009
quotequote all
The latest version of Firefox does away with the % issue entirely (or at least hides it well).
Maybe download Firefox, even if it's just to test it out?

For example my address bar looks like this in Firefox:


And this in IE:


So not a fix as such, but maybe a workaround?