Aaron Thomas
Aaron Thomas

Reputation: 5281

Is there a reason my browser percent decodes a uri?

When I type the following into Firefox or Chrome:

http://localhost:50102/my%2Ftest/one

... and I look at the request header, it shows:

http://localhost:50102/my/test/one

Why would it do this?

Upvotes: 0

Views: 32

Answers (1)

Michael Piefel
Michael Piefel

Reputation: 19998

Because it’s meant to do exactly that. The % introduces a two-digit hex number that is taken as a single character. 0x2F happens to be / in ASCII. To encode a space, you’d use %20.

Upvotes: 1

Related Questions