How to maintain points in WebApi2 URLs for a pool running in classic mode

I need to support points in URLs, for example http://myserver/product/find?name=the.product.namefor a pool working in Classic mode .

Here are some good questions and answers:

but none of them work for an application pool running in classic mode.

I tried:

  • <httpRuntime relaxedUrlToFileSystemMapping="true">...
  • <modules runAllManagedModulesForAllRequests="true">...
  • <handlers><add name="ApiURIs-ISAPI-Integrated-4.0" path="/people/*" verb="..." type="System.Web.Handlers.ransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
  • <modules>...<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" />

none of them work in Classic.

The only unacceptable workaround is to add the end /if the point is in the URL or an optional parameter, if the point is in the parameters:

  • http://myserver/product/find.all/
  • http://myserver/product/find?name=the.product.name&useless=1

Integrated.

+4
1

classicMode

  <handlers>
    <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit"/>
    <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" 
      path="*" 
      verb="GET,HEAD,POST,DEBUG,DELETE,OPTIONS" 
      modules="IsapiModule" 
      scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" 
      preCondition="classicMode,runtimeVersionv4.0,bitness32" 
      responseBufferLimit="0" />

    <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit"/>
    <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" 
      path="*" 
      verb="GET,HEAD,POST,DEBUG,DELETE,OPTIONS" 
      modules="IsapiModule" 
      scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" 
      preCondition="classicMode,runtimeVersionv4.0,bitness64" 
      responseBufferLimit="0" />
  </handlers>
+2

Source: https://habr.com/ru/post/1616439/


All Articles