I'm trying to validate an oncoming request, in the OnInitialise action of my reactive web page. However, the request has a long string, which is a token. Unfortunately this is the only way the upstream system can send the data.
I understand the limitations with the IIS server, not being able to handle more than a certain length of characters and hence it throws a 404 error. I'm just wondering if anyone has a suggestion on how we might be able to handle it?
PS. There is no way to change the source system.
Hi Tanveer,
Recently I read a post, similar (almost) to the same concern you mentioned and the solution was to shorten the URL using https://tinyurl.com/
I never personally used it, but you can give it a try.
Hope this help!
Regards,
Benjith Sam
Thank you for that quick response. I think, I have a requirement to read the token, so I am not sure how shortening it would help.
Also, because these are tokens, you would not want to use a 3rd party service to store/create links on your behalf.
Is not a good practice to have a token with this long in a request url... you should to review this approach.
Even so, if this is a "must have" in your scenario, it is possible to change change the maxQueryString setting https://blog.elmah.io/fix-max-url-and-query-string-length-with-web-config-and-iis/
maxQueryString
Another option is pass the token in a post request, sending it in the body intead of the URL.
Here are some good practices you should consider: