Railo 服务器将加号 (+) 转换为空格

发布于 2024-12-14 20:10:48 字数 179 浏览 7 评论 0原文

我在 Railo 服务器上注意到了一件奇怪的事情。 当我 cfdumpcfoutput 时,我在 url 中传递的所有 + 字符都会自动转换为空格。

是否需要更改服务器设置以使 + 仍为 +

Weird thing I noticed on my Railo server.
All + characters I pass in the url are automatically converted to spaces when I cfdump or cfoutput them.

Any server setting to change so that a + will remain a +?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怪我入戏太深 2024-12-21 20:10:48

Railo 不会将 + 字符转换为空格 - 您的浏览器会这样做。

(如果您在 ColdFusion 上运行完全相同的代码,您将得到相同的行为。)

在 URL 中,+ 是保留字符,需要编码为 %2B,并且还有其他几个字符也需要编码

您可以使用 CFML 函数 UrlEncodedFormat 对文本进行编码以在 URL 中使用。

Railo is not converting the + characters to space - your browser is.

(If you run the exact same code on ColdFusion you will get the same behaviour.)

In URLs, + is a reserved character and needs to be encoded as %2B, and there are several other characters that require encoding too.

You can use the CFML function UrlEncodedFormat to encode text for use in a URL.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文