cors 处理OPTIONS verb

摘要:
配置需要添加runAllManagedModulesForAllRequests=true<system。webServer˃可以捕获所有请求,但它会浪费系统资源并处理文件请求。此开关的功能是加载所有请求

配置需要加上 runAllManagedModulesForAllRequests = true

  <system.webServer>

    <modules  runAllManagedModulesForAllRequests="true">
    </modules>
  </system.webServer>

就可以捕获所有的请求了,但是会造成系统资源的浪费,会处理文件请求啊  等等,这个开关的作用就是对每一个请求都加载所有的处理Modules

可以仅仅添加对OPTIONS的处理,例如

  <system.webServer>
    <modules runAllManagedModulesForAllRequests="false">
  
    </modules>
    <handlers>
      <add name="optionsHandler" path="*." verb="OPTIONS" type="demo.Handler1,demo" preCondition="integratedMode,runtimeVersionv4.0"/>
    </handlers>
  </system.webServer>

这样就可以进入到了Handler1.ashx中去了

免责声明:文章转载自《cors 处理OPTIONS verb》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇spring中创建bean的方式ARMGNU伪指令下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

C#面向对象思想计算两点之间距离

题目为计算两点之间距离。 面向过程的思维方式,两点的横坐标之差,纵坐标之差,平方求和,再开跟,得到两点之间距离。 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; names...

StringBuilder类

   ===================================================================================================================== 2.String与StringBuilder原理对比  ============================...

C#获取当前路径

//获取包含清单的已加载文件的路径或 UNC 位置。         public static string sApplicationPath = Assembly.GetExecutingAssembly ( ).Location;         //result: X:\xxx\xxx\xxx.dll (.dll文件所在的目录+.dll文件名)...

CMD命令

最近接触了一些CMD命令相关的东西 ----------------------------------------------------------------------首先是一个不停拷贝文件的小东西 #include<windows.h>int main(){ system("mkdir new"); system("mkdir tem...

system执行shell命令

system - execute a shell command #include <stdlib.h> int system (const char *command); 描述 The system() uses fork to create a child process that executes a command specified...

Jenkins基于https的k8s配置

Jenkins基于https的k8s配置 登录jenkins,点击 Manage Jenkins --> Manage Plugins --> 可选插件 在搜索框中,输入关键字 kubernetes 选择安装完成后重启Jenkins 重新登录后,点击 Manage Jenkins --> Configure System, 将网页拉...