Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

400 bad request

29 views
Skip to first unread message

John Hanauer

unread,
Jan 15, 2003, 3:36:19 PM1/15/03
to
Is there any way to get an isapi filter to deal with a 400 bad request?
either pre or post processing?

Problem is, certain browsers (for instance AOL IM built in browser) will not
replace spaces with %20. Therefore, the request comes into IIS as

GET /hello there/index.aspx HTTP/1.1

So that iis starts thinking that the page is /hello and that the protocol is
there/index.aspx instead of http/1.1 and that HTTP/1.1 is misplaced text.

Is there anyway to intercept the clients full header text and process it in
this manner? to fix the problem?

Apache used to have this problem just like IIS but released a new version
that fixed it (I've heard rumors they fix it by making clients who wich to
allow spaces include "a=b" in their querystring, if this helps any)

Any help would be greatly appreciated ... If this is not possible, anyone
know how I go about possibly suggesting a fix to microsoft? IF not, I might
have to seriously consider switching to apache and mono.net
(http://www.go-mono.com/)

John


Wade A. Hilmo [MS]

unread,
Jan 15, 2003, 5:35:55 PM1/15/03
to
Hi John,

Clients that don't escape encode spaces are just plain broken. HTTP uses
spaces to differentiate the method and URL, and the URL and HTTP version.
There is no allowance whatsoever for a client to include a space in the URL.
There is no way that any web server could "fix" this, because it's a very
obvious client problem.

In IIS 5.1 and earlier (or compatibility mode in the upcoming IIS 6), it
would be possible to write a READ_RAW_DATA filter to escape encode data any
way that you like. You have the problem of knowing what spaces are
delimiters and what spaces should be escaped - and if you guess wrong,
you'll get bad results. Since IIS 6's native mode does not support
READ_RAW_DATA filters, there would be no way at all to do a hack like this
in IIS 6 native mode.

Thank you,
-Wade Hilmo,
-Microsoft

"John Hanauer" <hearts...@insightbb.com> wrote in message
news:7DjV9.691649$WL3.722429@rwcrnsc54...

John Hanauer

unread,
Jan 15, 2003, 7:35:24 PM1/15/03
to
I think that's why Apache uses that &a=b trick in the querystring to ensure
that it's supposed to format the string in such way ... question, does HTTP
require a return character after each line like most clients provide for?

John.

PS - thanks for the help, this is what I was looking for

"Wade A. Hilmo [MS]" <wa...@microsoft.com> wrote in message
news:eyvupZOvCHA.1960@TK2MSFTNGP11...

John Hanauer

unread,
Jan 16, 2003, 12:22:13 AM1/16/03
to
Decided to take a different approach ... using the new .NET framework, I
just wrote a program to setup a system.net.tcplistener on a port other than
HTTP, interpret the AIM request, replace spaces with %20's, and then reply
to AIM with a 302 redirect to the new link with spaces ... amazingly, this
works, I would have thought that aim would have had support for spaces in
links BEFORE they had support for 302 redirects. Amazing.

This way, I dont' have to touch my IIS server, and I can still link within a
profile.

Thanks, ciao.

John.

"Wade A. Hilmo [MS]" <wa...@microsoft.com> wrote in message
news:eyvupZOvCHA.1960@TK2MSFTNGP11...

Steven J. Sobol

unread,
Jan 24, 2003, 5:52:37 PM1/24/03
to
From John Hanauer (hearts...@insightbb.com):

> I think that's why Apache uses that &a=b trick

?? What trick are you talking about? I've been programming for Apache
for much longer than I've been programming for IIS, and I don't have
a clue what you're referring to.

--
Steve Sobol, CTO JustThe.net LLC, Mentor On The Lake, OH
http://JustTheNetLLC.com/ 888.480.4NET (4638)

A practicing member of the Geek Orthodox religion!

0 new messages