禁止在Azure网站请求验证 [英] Disabling request validation on Azure Websites

查看:144
本文介绍了禁止在Azure网站请求验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Node.js应用程序运行很好我自己的机器上,但是,使用Git,我收到请求验证的问题推到了Azure的网页后。

My node.js application runs nicely on my own machine, however, after pushing it up to an Azure WebSite using Git, I'm getting request validation problems.

我的一些请求由IIS验证过程被困。解决方法是将它添加到Web.config:

Some of my requests are trapped by the IIS validation process. The fix is to add this to the web.config:

<httpRuntime requestPathInvalidCharacters=""/>

我下载使用FTP我的网站的网站\\ wwwroot文件夹中的web.config,它加入到回购,增加了XML的新元素,并推动它备份到Azure上。

I downloaded the web.config from the site\wwwroot folder of my website using FTP, added it to the repo, added the new element in the XML, and pushed it back up to Azure.

我的web.config文件似乎已经被默认覆盖。

My web.config file seems to have been overridden by the default.

有没有改变这种行为的一种方式?或关闭请求验证的另一种方式?还是我只是被厚厚的?

Is there a way of changing this behaviour? Or another way of turning off request validation? Or am I just being thick?

更新

我把它都回来了,这似乎是它阻止请求前preSS。然而,问题仍然有效的如何定制我的web.config?

I take it all back, it seems to be express which is blocking the request. However, the question still stands as 'how do I customise my web.config?'

推荐答案

您可以尝试设置自定义验证类型?像这样的:

Could you try setting a custom validation type? Like this:

  <httpRuntime requestPathInvalidCharacters=""
               requestValidationType="MyValidator, MyAssembly"/>

和类:

public class MyValidator : RequestValidator
{
    protected override bool IsValidRequestString(HttpContext context, string value, RequestValidationSource requestValidationSource, string collectionKey, out int validationFailureIndex)
    {
       validationFailureIndex = 0;
       return true;
    }
}

这篇关于禁止在Azure网站请求验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆