我的浏览器百分比解码 uri 是否有原因?

Is there a reason my browser percent decodes a uri?

当我在 Firefox 或 Chrome 中输入以下内容时:

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

... 我查看了请求 header,它显示:

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

为什么要这样做?

因为它就是这样做的。 % 引入了一个 two-digit 十六进制数字,该数字被视为单个字符。 0x2F 恰好是 ASCII 中的 /。要对 space 进行编码,您需要使用 %20.