Welcome to HostingForumz.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

URL too long results in Bad Request (Invalid URL)

 
   Web Hosting Problem Solving Community! (Home) -> IIS RSS
Related Topics:
Len(URL) = 312 but we get "HTTP 414 - Request - URI Too Lo.. - Hi - I have just extended an existing URL to be 312 long and now IIS 5 on W2K (SP2) is giving me a 414 in response to it. The URL looks like this:

IIS6 - 400 - Bad request (Invalid URL) - Hi, I'm getting a 400 - Bad request (invalid URL) error with IIS6 / Windows 2003 when executing the following URL:

Bad Request (Invalid Verb) - We have an ASP .NET that in its own sub folder beneath our main site. Users access it via a link we have created inside of the OWA but the is not with OWA. The OWA and the link to our are..

IIS : Bad Request (Invalid Hostname) - Hi! I've removed web from "web folder, in Internet Service. Now I cannot access to any site from the server when I use or the static IP. It returns the message: "Bad Request

IIS 6 bad request (invalid verb) - this is a request that i am trying to send to an .aspx page on the IIS 6 server, using an c++ POST 242766 but i get an HTTP/1.1 400..
Next:  HELP! RewriteRule gives 404 Not Found  
Author Message
JPElectron

External


Since: Feb 23, 2008
Posts: 4



(Msg. 1) Posted: Sat Feb 23, 2008 9:05 pm
Post subject: URL too long results in Bad Request (Invalid URL)
Archived from groups: microsoft>public>inetserver>iis (more info?)

I have a site based entirely in .asp - occasionally a link to a page
(URL + query string) will be generated that seems to be too long for
either the browser to display or the web server to serve...

For example, if the address bar has a URL with 375 characters, all you
get is: Bad Request (Invalid URL)

If it has 371 characters, I still get: Bad Request (Invalid URL)

If I cut off a few, so it's 370 characters or less, the page will
display fine. Note that I'm not changing anything else in the line,
I'm just cutting off a few characters (numbers in this case) from the
end.

The real question here, is when I set a custom 400 error, which I
assume is what's producing the: Bad Request (Invalid URL) error to
display - I can't get my custom error page to display, I still get
just: Bad Request (Invalid URL)

Any idea why my custom error isn't working?

 >> Stay informed about: URL too long results in Bad Request (Invalid URL) 
Back to top
Login to vote
kenremove

External


Since: Aug 23, 2003
Posts: 3041



(Msg. 2) Posted: Sun Feb 24, 2008 10:03 am
Post subject: Re: URL too long results in Bad Request (Invalid URL) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

What version of IIS are you using? in IIS 6.0, 400 errors are usually
generated by http.sys, not by IIS

Check httperr.log file to see if http.sys is generating the error. If so,
then I don't think there's anything you can do to customise that error
message.

Cheers
Ken

"JPElectron" <jp.maurer DeleteThis @gmail.com> wrote in message
news:46099665-1e26-4d45-89d0-f51b9f6f0eef@q33g2000hsh.googlegroups.com...
>I have a site based entirely in .asp - occasionally a link to a page
> (URL + query string) will be generated that seems to be too long for
> either the browser to display or the web server to serve...
>
> For example, if the address bar has a URL with 375 characters, all you
> get is: Bad Request (Invalid URL)
>
> If it has 371 characters, I still get: Bad Request (Invalid URL)
>
> If I cut off a few, so it's 370 characters or less, the page will
> display fine. Note that I'm not changing anything else in the line,
> I'm just cutting off a few characters (numbers in this case) from the
> end.
>
> The real question here, is when I set a custom 400 error, which I
> assume is what's producing the: Bad Request (Invalid URL) error to
> display - I can't get my custom error page to display, I still get
> just: Bad Request (Invalid URL)
>
> Any idea why my custom error isn't working?

 >> Stay informed about: URL too long results in Bad Request (Invalid URL) 
Back to top
Login to vote
JPElectron

External


Since: Feb 23, 2008
Posts: 4



(Msg. 3) Posted: Sun Feb 24, 2008 4:31 pm
Post subject: Re: URL too long results in Bad Request (Invalid URL) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

yes, I'm using IIS 6 (Windows 2003) and your right, these errors show
up in WINDOWS\system32\LogFiles\HTTPERR\httperr1.log

So what's the point/difference in defining a custom 400 error in IIS?

Is there any way to show a different page/message when this happens?
 >> Stay informed about: URL too long results in Bad Request (Invalid URL) 
Back to top
Login to vote
kenremove

External


Since: Aug 23, 2003
Posts: 3041



(Msg. 4) Posted: Mon Feb 25, 2008 6:16 am
Post subject: Re: URL too long results in Bad Request (Invalid URL) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"JPElectron" <jp.maurer.DeleteThis@gmail.com> wrote in message
news:42e681a3-7511-4de5-b34d-3c20050bcf45@c33g2000hsd.googlegroups.com...
> yes, I'm using IIS 6 (Windows 2003) and your right, these errors show
> up in WINDOWS\system32\LogFiles\HTTPERR\httperr1.log
>
> So what's the point/difference in defining a custom 400 error in IIS?

I suppose for 400 errors that are generated elsewhere. You can certainly
write your own app that generates "Bad Request" status for whatever reason
you feel like (even if the request technically doesn't contravene the HTTP
specification)

> Is there any way to show a different page/message when this happens?

Not that I'm aware of - well, not within IIS (since http.sys is lower down
in the stack). I don't know much about interfacing with the http.sys API,
but that would probably be the place you'd need to do this work.

Oddly enough, I didn't think that the HTTP spec defined a length for URIs,
and 400 characters seems like a low limit (unless there's also a
corresponding limit in file paths lengths in Windows - maybe in FAT32 -
since that would be the lowest common denominator file system).

Cheers
Ken
 >> Stay informed about: URL too long results in Bad Request (Invalid URL) 
Back to top
Login to vote
JPElectron

External


Since: Feb 23, 2008
Posts: 4



(Msg. 5) Posted: Mon Feb 25, 2008 10:33 pm
Post subject: Re: URL too long results in Bad Request (Invalid URL) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Based on some DNS trickery I am able to resolve the domains of some
sites (lets just say unwanted sites) to my own IIS server instead
(this based on corporate policy)

Here are the sample URLs, although I've changed the domain-names to
protect the guilty...

don't work = Bad Request (Invalid URL)
http://ad.dooaaaccaaa.net/adr/Saaaaaaa/saaaaaaa.com.dart;type=Banner;c...k=http:
(375 characters)

works = content replaced because my 404 error page redirects to my
default document ok
http://ad.dooaaaccaaa.net/adr/Saaaaaaa/saaaaaaa.com.dart;type=Banner;c...k=http:
(370 characters)
 >> Stay informed about: URL too long results in Bad Request (Invalid URL) 
Back to top
Login to vote
Bernard Cheah [MVP]

External


Since: May 31, 2005
Posts: 346



(Msg. 6) Posted: Tue Feb 26, 2008 2:04 am
Post subject: Re: URL too long results in Bad Request (Invalid URL) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Anything that is kernel mode response, you can customize the error page,
just like 503.

Also bad request 400 for invalid url should not be related to url too long,
if you got then it should be url_length in the reason phrase.

what's so special about ur request url ?

--
Regards,
Bernard Cheah
http://www.iis.net/
http://msmvps.com/blogs/bernard/


"Ken Schaefer" <kenREMOVE DeleteThis @THISadOpenStatic.com> wrote in message
news:eEM2254dIHA.4712@TK2MSFTNGP04.phx.gbl...
> "JPElectron" <jp.maurer DeleteThis @gmail.com> wrote in message
> news:42e681a3-7511-4de5-b34d-3c20050bcf45@c33g2000hsd.googlegroups.com...
>> yes, I'm using IIS 6 (Windows 2003) and your right, these errors show
>> up in WINDOWS\system32\LogFiles\HTTPERR\httperr1.log
>>
>> So what's the point/difference in defining a custom 400 error in IIS?
>
> I suppose for 400 errors that are generated elsewhere. You can certainly
> write your own app that generates "Bad Request" status for whatever reason
> you feel like (even if the request technically doesn't contravene the HTTP
> specification)
>
>> Is there any way to show a different page/message when this happens?
>
> Not that I'm aware of - well, not within IIS (since http.sys is lower down
> in the stack). I don't know much about interfacing with the http.sys API,
> but that would probably be the place you'd need to do this work.
>
> Oddly enough, I didn't think that the HTTP spec defined a length for URIs,
> and 400 characters seems like a low limit (unless there's also a
> corresponding limit in file paths lengths in Windows - maybe in FAT32 -
> since that would be the lowest common denominator file system).
>
> Cheers
> Ken
 >> Stay informed about: URL too long results in Bad Request (Invalid URL) 
Back to top
Login to vote
Bernard Cheah [MVP]

External


Since: May 31, 2005
Posts: 346



(Msg. 7) Posted: Tue Feb 26, 2008 7:12 am
Post subject: Re: URL too long results in Bad Request (Invalid URL) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Correction on previous post - I mean "you can't customize'... as it is
kernel mode.
mm.... your sample url trigger nothing on my mind. just 5 char diff Smile

can you post the complete line of the httperr.log file?
it didn't reach IIS log right?


--
Regards,
Bernard Cheah
http://www.iis.net/
http://msmvps.com/blogs/bernard/


"JPElectron" <jp.maurer.TakeThisOut@gmail.com> wrote in message
news:3533059d-7fdf-4789-9af0-3061d5287b4e@64g2000hsw.googlegroups.com...
> Based on some DNS trickery I am able to resolve the domains of some
> sites (lets just say unwanted sites) to my own IIS server instead
> (this based on corporate policy)
>
> Here are the sample URLs, although I've changed the domain-names to
> protect the guilty...
>
> don't work = Bad Request (Invalid URL)
> http://ad.dooaaaccaaa.net/adr/Saaaaaaa/saaaaaaa.com.dart;type=Banner;c...k=http:
> (375 characters)
>
> works = content replaced because my 404 error page redirects to my
> default document ok
> http://ad.dooaaaccaaa.net/adr/Saaaaaaa/saaaaaaa.com.dart;type=Banner;c...k=http:
> (370 characters)
 >> Stay informed about: URL too long results in Bad Request (Invalid URL) 
Back to top
Login to vote
Daniel Crichton

External


Since: Apr 21, 2006
Posts: 158



(Msg. 8) Posted: Tue Feb 26, 2008 1:13 pm
Post subject: Re: URL too long results in Bad Request (Invalid URL) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

JPElectron wrote on Mon, 25 Feb 2008 22:33:27 -0800 (PST):

> Based on some DNS trickery I am able to resolve the domains of some
> sites (lets just say unwanted sites) to my own IIS server instead (this
> based on corporate policy)

> Here are the sample URLs, although I've changed the domain-names to
> protect the guilty...

Have you got URLScan installed and enabled? It has options for setting
allowable lengths on URLs. Also there are registry settings for HTTP.sys,
but I've checked my own server and they're not present by default:

The HTTP.SYS component used by IIS 6.0 allows size limits to be set on
various parts of the request. The values can be changed by modifying
AllowRestrictedChars, MaxFieldLength, UrlSegmentMaxLength, and
UrlSegmentMaxCount in the registry under the following registry keys:
•HKEY_LOCAL_MACHINE\System\CurrentControlSet\
Services\HTTP\Parameters\AllowRestrictedChars
•HKEY_LOCAL_MACHINE\System\CurrentControlSet\
Services\HTTP\Parameters\MaxFieldLength
•HKEY_LOCAL_MACHINE\System\CurrentControlSet\
Services\HTTP\Parameters\UrlSegmentMaxLength
•HKEY_LOCAL_MACHINE\System\CurrentControlSet\
Services\HTTP\Parameters\UrlSegmentMaxCount


(above from http://www.microsoft.com/technet/security/tools/urlscan.mspx)

--
Dan
 >> Stay informed about: URL too long results in Bad Request (Invalid URL) 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting Problem Solving Community! (Home) -> IIS All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]