Problem with very large URL

Asked

Viewed 1,364 times

6

I am trying to pass a URL by GET and the server is returning error 404 by the URL being too large (I am passing an XML through the URL).

I have already tried to add the Maxfieldlength variables with 1677721 and Maxrequestbytes with 1677721 in the Windows registry, as the link below:

http://technet.microsoft.com/pt-br/library/aa996475(v=exchg.80). aspx

Note: Operating system is Windows Server 2012.

  • From what I understand the IIS can limit the size of the URL according to the link I passed the question or I’m wrong?

  • Probably the browser won’t even send the entire URL.

  • The URL that I am testing has more or less 3018 characters, when I try on my host that the protocol is falling straight into Jboss works, but when having to the server that the IIS sends to Jboss hangs in the ISS and returns the error 404.

  • Take a look at Onosendai’s answer about the IIS part. Mine is more focused on the issue of uploads by browsers same.

2 answers

7

This response is a partial translation of a reference from Lonely


Short answer: keep URL at 2000 bytes

Keeping it below 2k, the URL will work in virtually any condition.


Long answer: first, the standards...

To RFC 2616 (Hypertext Transfer Protocol HTTP/1.1) section 3.2.1 says:

The HTTP Protocol does not place any a priori limit on the length of
a URI. Servers MUST be Able to Handle the URI of any Resource they serve, and SHOULD be Able to Handle Uris of unbounded length if they provide GET-based Forms that could generate such Uris. A server SHOULD Return 414 (Request-URI Too Long) status if a URI is longer than the server can Handle (see Section 10.4.15).

and also:

Note: Servers ought to be cautious about pending on URI lengths above 255 bytes, because some Older client or proxy implementations Might not properly support These lengths.

In short, the HTTP protocol should not impose a limit on the size of a URI, and should be able to resolve Gets of any size coming from Forms. If the server cannot resolve the reported size URI, it must return a 414.


... and the reality.

There is research in boutell. whose summary is:

Extremely long Urls are usually a mistake. Urls over 2,000 characters will not work in the Most popular web browsers. Don’t use them if you intend your site to work for the Majority of Internet users.

Which in short says Urls larger than 2000 characters will not work in most browsers.

In other words, even if you set up the server for larger requests, you probably still need to do them by other means than a browser, such as Curl and the like.

6

In the archive Web.Config of your application on the IIS server, adjust the values maxQueryString and maxUrl to the desired size:

<configuration>
   <system.webServer>
      <security>
         <requestFiltering>
            <requestLimits maxQueryString="8192" maxUrl="8192" />
         </requestFiltering>
      </security>
   </system.webServer>
</configuration>

For very large files, and if the current implementation of your service allows, it would be interesting to modify your code to use POST instead of GET.

Source: IIS.net

Browser other questions tagged

You are not signed in. Login or sign up in order to post.