繁体   English   中英

Apache 2.4.37:即使添加到 VirtualHost,AllowEncodedSlashes On 也不起作用

[英]Apache 2.4.37: AllowEncodedSlashes On not working even after added to VirtualHost

我已经阅读了所有相关的帖子,但它们似乎并没有解决我的问题。 我正在为 Windows 运行 XAMPP。 我正在编写一个需要接受可能嵌入斜杠的参数的 rest api。 我在 httpd.conf 和 http-vhosts.conf 中都设置了 AllowEncodedSlashes On 但它仍然无法工作(顺便说一句 - 是的 - 停止并重新启动了appache!)。 任何帮助,将不胜感激。 - 谢谢。

在 httpd.conf 中:

...

ServerRoot "C:/xampp/apache"
AllowEncodedSlashes On

在 http-vhosts.conf 中:...

<VirtualHost *:80>
    DocumentRoot "c:/xampp/htdocs/odie/public"  
    ServerName odie
    AllowEncodedSlashes On
</VirtualHost>

我无法解决这个特定问题 - 但我意识到我可能是错误地处理了这个问题。 我没有尝试更改服务器设置,而是一直在对 base-64 进行编码/解码。 这使我可以通过任何角色而不会感到任何进一步的悲伤。

就我而言,我在前端使用 Angular,在后端使用 PHP。

角度代码是:

 private encodeParameter(parm: string) {
        if (!parm) {
            return null;
        }
        return btoa(parm);
    }

PHP代码是:

  public static function decode_parameter($parameter){
            return base64_decode($parameter); 
        }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM