Getting CORS To Work With Nancy

后端 未结 3 1646
面向向阳花
面向向阳花 2021-01-11 14:53

I am trying to get all types of requests to work with Nancy and CORS. Currently I add a pipeline at the end of the request:

            pipelines.AfterReques         


        
3条回答
  •  抹茶落季
    2021-01-11 15:47

    I find it nicer to handle CORS headers in IIS rewriter rules this is sample rewrite webconfig section which does that:

    
      
        
          
          
        
        
          
          
        
        
          
          
        
        
          
          
        
        
          
            
            
          
        
      
    
    

    Remember to install IIS rewrite module: http://www.iis.net/downloads/microsoft/url-rewrite

提交回复
热议问题