loopback-connector-swagger icon indicating copy to clipboard operation
loopback-connector-swagger copied to clipboard

While sending GET request with Parameters value with special Charachter like Backslash(\),Forwardslash(/) and all using Odata REST API

Open Jeegen opened this issue 6 years ago • 8 comments

This is my web.config

<system.web>
    <pages validateRequest="false" />
    <httpRuntime requestPathInvalidCharacters=""  />
  </system.web>

<modules runAllManagedModulesForAllRequests="true"></modules>
    <handlers>
      <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
      <remove name="OPTIONSVerbHandler" />
      <remove name="TRACEVerbHandler" />
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
      
    </handlers>

  <security>
    <requestFiltering allowDoubleEscaping="true" />
  </security>

There is two key and value UserId='XX\XXXX' and UserName='XXXXXX'.

Passing Parameters Value with backslash(\) than error 404 occurs.

http://localhost/ProjectName/ControllerName(UserId='PC\Test',UserName='anonymous')

c# asp.net-web-api odata odata-rest-api

Jeegen avatar Dec 12 '19 11:12 Jeegen

Try to use encode the special chars, for example:

\ -> %5C
/ -> %2F

raymondfeng avatar Dec 12 '19 16:12 raymondfeng

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 11 '20 20:02 stale[bot]

Try to use encode the special chars, for example:

\ -> %5C
/ -> %2F

I already tried Earlier but this is not working.

Jeegen avatar Feb 20 '20 07:02 Jeegen

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Jeegen avatar Feb 20 '20 07:02 Jeegen

Still Facing Same Issue With Backward and forward slash. I'm Using Swagger Documentation for Rest API. I entered record in swagger that time this error is occurred and also with query string.

Jeegen avatar Feb 20 '20 07:02 Jeegen

@Jeegen Please use https://github.com/strongloop/loopback-connector-openapi instead. Let us know if you have the same issue.

raymondfeng avatar Feb 20 '20 15:02 raymondfeng

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 23 '20 04:04 stale[bot]

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

stale[bot] avatar May 07 '20 05:05 stale[bot]