dongya8378 2019-02-02 21:42
浏览 88

有没有办法在网址中允许不安全的字符?

I've been trying to upgrade a old Game Server Api that sends requests using special non safe characters such as 0x20 and 0x08

Request sent from the application

Answer from apache after the request

What I've trying doing is changing the .htaccess to get those special characters and replace then to their %hex as any other browser would do.

RewriteRule ^(.*)\x08(.*)$ $1%08$2 [B]
RewriteRule ^(.*)\x20(.*)$ $1%20$2 [B]

I've also added the following option to my apache2.conf

HttpProtocolOptions unsafe

One way that it works is using IIS to host the php and using Windows Registry Editor to force IIS to allow unescaped characters.

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters]
"DisableServerHeader"=dword:00000001
"AllowUnEscapedRestrictedChars"=dword:00000001
"AllowWeakHeaderValueSyntax"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters\SslBindingInfo]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters\UrlAclInfo]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters\Synchronize]

But then using that I can't run the main API in a Linux based machine - which is the goal for this project. I would like to know if someone already came across with this issue. I want to be able to request unsafe characters on urls without crashing. They must be unescaped in the url because the data source sends the special characters as unescaped

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 安装svn网络有问题怎么办
    • ¥15 Python爬取指定微博话题下的内容,保存为txt
    • ¥15 vue2登录调用后端接口如何实现
    • ¥65 永磁型步进电机PID算法
    • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
    • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
    • ¥15 如何处理复杂数据表格的除法运算
    • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
    • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
    • ¥15 latex怎么处理论文引理引用参考文献