 |
|
 |
|
|
 |
IIS Bug on redirect (wrong Content Length header!!!) |
 |
 |
|
|
07-21-05 12:48 PM
My Webapplication returns the content and the content length in a
redirection answer (302). Now the problem is that IIS 6 does replace that
content from my webapplication and puts it's own redirect html content into
the response. But!!! It doesn't set the Content Length to the correct size
of its own html content!!!!
As a result of this, the Content Length header has a wrong value witch
doesnt fit the real content length. So if IE should do a redirect it waits
forever to get all content which is smaller in this case than what my
webapplication did return. So it waits for additional 53 bytes, which it
never will get and a timeout occurs.
Content Length of the IIS6 redirect html content is 146 but the Content
Length header is still set to 199, which is the length I did set in my
webapplication for my content, which is 199 bytes long.
Where can we log that bug so it will be fixed?
Regards
Rolf
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: IIS Bug on redirect (wrong Content Length header!!!) |
 |
 |
|
|
07-22-05 12:54 PM
Please give:
1. the application code you use to return the 302 response
2. the configuration that causes IIS6 te reploce your 302 content
I am not aware of any IIS6 behavior which replaces content of a response, so
I need detailed configuration that can reproduce this. I need to know the
Windows patch level, and as much IIS configuration as you can determine to
reproduce this. If you do not give enough configuration detail for me to
reproduce it, then this issue really does not exist for us to see and fix
it.
Standard disclaimer:
As with any supported Microsoft product, you can call/contact PSS to report
issues. However, PSS will attempt to get the same sort of information I just
asked of you, and if it is insufficient or turns out to be "by-design", they
may charge you and/or reject your issue due to insufficient data to take
action.
In other words -- not all bugs can be filed (they have to have enough
information to be actionable -- otherwise, we cannot do anything about it
because we cannot reproduce it to fix it), and not all bugs are fixed (this
is what people usually do not understand -- but realize that with every fix
there is cost, risk, and benefit -- and if the benefit is too risky/costly,
the bug won't get fixed).
--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Rolf" <no.email@no.com> wrote in message
news:uF5j8lejFHA.3144@TK2MSFTNGP12.phx.gbl...
My Webapplication returns the content and the content length in a
redirection answer (302). Now the problem is that IIS 6 does replace that
content from my webapplication and puts it's own redirect html content into
the response. But!!! It doesn't set the Content Length to the correct size
of its own html content!!!!
As a result of this, the Content Length header has a wrong value witch
doesnt fit the real content length. So if IE should do a redirect it waits
forever to get all content which is smaller in this case than what my
webapplication did return. So it waits for additional 53 bytes, which it
never will get and a timeout occurs.
Content Length of the IIS6 redirect html content is 146 but the Content
Length header is still set to 199, which is the length I did set in my
webapplication for my content, which is 199 bytes long.
Where can we log that bug so it will be fixed?
Regards
Rolf
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: IIS Bug on redirect (wrong Content Length header!!!) |
 |
 |
|
|
07-22-05 12:54 PM
Hi David
Thanks for your answer.
> 1. the application code you use to return the 302 response
It is Delphi code, it's not difficult to understand so it comes here (see
what it exactly produces below):
procedure TCGIResponse.SendRedirect(const URI: string);
const
sDocumentMoved = '<html><title>Dokument wurde verschoben
302</title>'#13#10 +
'<body><h1>Objekt wurde verschoben</h1><hr>'#13#10 +
'Das Objekt kann <a HREF="%s">hier</a> gefunden werden.<br>'#13#10 +
'<br></body></html>'#13#10;
begin
Location := URI;
StatusCode := 302;
ContentType := 'text/html'; { do not localize }
Content := Format(sDocumentMoved, [URI]);
SendResponse;
end;
procedure TCGIResponse.SendResponse;
var
StatusString: string;
Headers: string;
I: Integer;
procedure AddHeaderItem(const Item, FormatStr: string);
begin
if Item <> '' then
Headers := Headers + Format(FormatStr, [Item]);
end;
begin
if HTTPRequest.ProtocolVersion <> '' then
begin
if (ReasonString <> '') and (StatusCode > 0) then
StatusString := Format('%d %s', [StatusCode, ReasonString])
else StatusString := '200 OK';
{do not localize }
AddHeaderItem(Location, 'Location: %s'#13#10);
{do not localize }
AddHeaderItem(Allow, 'Allow: %s'#13#10);
{do not localize }
for I := 0 to Cookies.Count - 1 do
AddHeaderItem(Cookies[I].HeaderValue, 'Set-Cookie: %s'#13#10);
{do not localize }
AddHeaderItem(DerivedFrom, 'Derived-From: %s'#13#10);
{do not localize }
if Expires > 0 then
AddHeaderItem(Format(FormatDateTime(sDat
eFormat + ' "GMT"',
{do not localize}
Expires), [DayOfWeekStr(Expires), MonthStr(Expires)]), 'Expires:
%s'#13#10); {do not localize}
if LastModified > 0 then
AddHeaderItem(Format(FormatDateTime(sDat
eFormat +
' "GMT"', LastModified), [DayOfWeekStr(LastModified),
{do not localize}
MonthStr(LastModified)]), 'Last-Modified: %s'#13#10);
{do not localize}
AddHeaderItem(Title, 'Title: %s'#13#10);
{do not localize }
AddHeaderItem(FormatAuthenticate, 'WWW-Authenticate: %s'#13#10);
{do not localize }
AddCustomHeaders(Headers);
AddHeaderItem(ContentVersion, 'Content-Version: %s'#13#10);
{do not localize }
AddHeaderItem(ContentEncoding, 'Content-Encoding: %s'#13#10);
{do not localize }
AddHeaderItem(ContentType, 'Content-Type: %s'#13#10);
{do not localize }
if (Content <> '') or (ContentStream <> nil) then
AddHeaderItem(IntToStr(ContentLength), 'Content-Length: %s'#13#10);
{do not localize }
Headers := Headers + 'Content:'#13#10#13#10;
{do not localize }
HTTPRequest.WriteHeaders(StatusCode, StatusString, Headers);
end;
if ContentStream = nil then
HTTPRequest.WriteString(Content)
else if ContentStream <> nil then
begin
SendStream(ContentStream);
ContentStream := nil; // Drop the stream
end;
FSent := True;
end;
Here is axactly what the above code does write:
======
Status: 302 Moved Temporarily
Location: http://www.easy-shop.ch
Set-Cookie: UID=363_133D3C; path=/mis30/
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"
Content-Type: text/html
Content-Length: 197
Content:
<html><title>Dokument wurde verschoben 302</title>
<body><h1>Objekt wurde verschoben</h1><hr>
Das Objekt kann <a HREF="http://www.easy-shop.ch">hier</a> gefunden
werden.<br>
<br></body></html>
======
> 2. the configuration that causes IIS6 te reploce your 302 content
What configuration do you meen exactly and how can I give it to you? I'm
using the default settings on a fresh installed Win2k3 Web Edition server.
I give you here some log I did with wfetch from the IIS Resource Kit against
IIS6.0 / IIS 5.1 / Apache 1.3 all with the same cgi web application. The
Apache Server is the only one who behaves correctly and uses my content, so
I post it at first:
**** Apache 1.3 ****
started....
WWWConnect::Connect("pc","80")\n
IP = "10.0.0.139:80"\n
source port: 1039\r\n
REQUEST: **************\n
GET /mis30/bin/srves.exe HTTP/1.1\r\n
Host: pc\r\n
Accept: */*\r\n
\r\n
RESPONSE: **************\n
HTTP/1.1 302 Moved Temporarily\r\n
Date: Fri, 22 Jul 2005 11:14:54 GMT\r\n
Server: Apache/1.3.27 (Win32)\r\n
Content: \r\n
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"\r\n
Set-Cookie: UID=352_13323D; path=/mis30/\r\n
Location: http://www.easy-shop.ch\r\n
Content-Length: 197\r\n
Content-Type: text/html\r\n
\r\n
<html><title>Dokument wurde verschoben 302</title>\r\n
<body><h1>Objekt wurde verschoben</h1><hr>\r\n
Das Objekt kann <a HREF="http://www.easy-shop.ch">hier</a> gefunden
werden.<br>\r\n
<br></body></html>\r\n
finished.
========================================
==
**** IIS 6 ****
started....
WWWConnect::Connect("localhost","80")\n
IP = "127.0.0.1:80"\n
source port: 1041\r\n
REQUEST: **************\n
GET /mis30/bin/srves.exe HTTP/1.1\r\n
Host: localhost\r\n
Accept: */*\r\n
\r\n
RESPONSE: **************\n
HTTP/1.1 302 Moved Temporarily\r\n
Content-Length: 197\r\n
Content-Type: text/html\r\n
Location: http://www.easy-shop.ch\r\n
Server: Microsoft-IIS/6.0\r\n
Set-Cookie: UID=31_133F; path=/mis30/\r\n
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"\r\n
Content: \r\n
Date: Fri, 22 Jul 2005 11:33:26 GMT\r\n
\r\n
<head><title>Document Moved</title></head>\n
<body><h1>Object Moved</h1>This document may be found <a
HREF="http://www.easy-shop.ch">here</a></body>
0x2746 Socket Error On Receive
0x2746 Socket Error On Receive
finished.
========================================
==
**** IIS 5.1 ****
started....
WWWConnect::Connect("pc","81")\n
IP = "10.0.0.139:81"\n
source port: 1045\r\n
REQUEST: **************\n
GET /mis30/bin/srves.exe HTTP/1.1\r\n
Host: pc\r\n
Accept: */*\r\n
\r\n
RESPONSE: **************\n
HTTP/1.1 302 Object Moved\r\n
Server: Microsoft-IIS/5.1\r\n
Date: Fri, 22 Jul 2005 11:46:44 GMT\r\n
Connection: close\r\n
Content-Type: text/html\r\n
Location: http://www.easy-shop.ch\r\n
Set-Cookie: UID=355_13323A; path=/mis30/\r\n
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"\r\n
Content-Length: 197\r\n
Content:\r\n
\r\n
<head><title>Document Moved</title></head>\n<body><h1>Object Moved</h1>This
document may be found <a HREF="http://www.easy-shop.ch">here</a></body>
finished.
========================================
==
You can see that the IIS 5 and 6 uses still my initial Content Length header
but not my content html. As a result of this, the content length doesn't fit
the content html. There was not a problem in IIS 5 because it did close the
connection (Connection: close Header) which IIS 6 doesn't use anymore.
I hope this information can help you to identify the problem in IIS. If you
want contact me by personal email you can do this with this email:
rolf[at]eicom.ch
Regards
Rolf
>
> I am not aware of any IIS6 behavior which replaces content of a response,
> so
> I need detailed configuration that can reproduce this. I need to know the
> Windows patch level, and as much IIS configuration as you can determine to
> reproduce this. If you do not give enough configuration detail for me to
> reproduce it, then this issue really does not exist for us to see and fix
> it.
>
> Standard disclaimer:
>
> As with any supported Microsoft product, you can call/contact PSS to
> report
> issues. However, PSS will attempt to get the same sort of information I
> just
> asked of you, and if it is insufficient or turns out to be "by-design",
> they
> may charge you and/or reject your issue due to insufficient data to take
> action.
>
> In other words -- not all bugs can be filed (they have to have enough
> information to be actionable -- otherwise, we cannot do anything about it
> because we cannot reproduce it to fix it), and not all bugs are fixed
> (this
> is what people usually do not understand -- but realize that with every
> fix
> there is cost, risk, and benefit -- and if the benefit is too
> risky/costly,
> the bug won't get fixed).
>
> --
> //David
> IIS
> http://blogs.msdn.com/David.Wang
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> //
> "Rolf" <no.email@no.com> wrote in message
> news:uF5j8lejFHA.3144@TK2MSFTNGP12.phx.gbl...
> My Webapplication returns the content and the content length in a
> redirection answer (302). Now the problem is that IIS 6 does replace that
> content from my webapplication and puts it's own redirect html content
> into
> the response. But!!! It doesn't set the Content Length to the correct size
> of its own html content!!!!
>
> As a result of this, the Content Length header has a wrong value witch
> doesnt fit the real content length. So if IE should do a redirect it waits
> forever to get all content which is smaller in this case than what my
> webapplication did return. So it waits for additional 53 bytes, which it
> never will get and a timeout occurs.
>
> Content Length of the IIS6 redirect html content is 146 but the Content
> Length header is still set to 199, which is the length I did set in my
> webapplication for my content, which is 199 bytes long.
>
> Where can we log that bug so it will be fixed?
>
> Regards
> Rolf
>
>
>
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: IIS Bug on redirect (wrong Content Length header!!!) |
 |
 |
|
|
07-24-05 08:07 AM
Ah, you are talking about a CGI. Is your CGI expecting NPH behavior or not?
When you run CGI in normal mode, the Location: header (along with
Content-Type and Status headers) is one of the CGI defined headers that
cause IIS to do response replacement according to normal CGI semantics.
Your CGI expects NPH behavior, so it needs to be named accordingly with a
nph- prefix. This behavior is by-design.
--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Rolf" <no.email@no.com> wrote in message
news:%23%23rWVdrjFHA.796@TK2MSFTNGP10.phx.gbl...
Hi David
Thanks for your answer.
> 1. the application code you use to return the 302 response
It is Delphi code, it's not difficult to understand so it comes here (see
what it exactly produces below):
procedure TCGIResponse.SendRedirect(const URI: string);
const
sDocumentMoved = '<html><title>Dokument wurde verschoben
302</title>'#13#10 +
'<body><h1>Objekt wurde verschoben</h1><hr>'#13#10 +
'Das Objekt kann <a HREF="%s">hier</a> gefunden werden.<br>'#13#10 +
'<br></body></html>'#13#10;
begin
Location := URI;
StatusCode := 302;
ContentType := 'text/html'; { do not localize }
Content := Format(sDocumentMoved, [URI]);
SendResponse;
end;
procedure TCGIResponse.SendResponse;
var
StatusString: string;
Headers: string;
I: Integer;
procedure AddHeaderItem(const Item, FormatStr: string);
begin
if Item <> '' then
Headers := Headers + Format(FormatStr, [Item]);
end;
begin
if HTTPRequest.ProtocolVersion <> '' then
begin
if (ReasonString <> '') and (StatusCode > 0) then
StatusString := Format('%d %s', [StatusCode, ReasonString])
else StatusString := '200 OK';
{do not localize }
AddHeaderItem(Location, 'Location: %s'#13#10);
{do not localize }
AddHeaderItem(Allow, 'Allow: %s'#13#10);
{do not localize }
for I := 0 to Cookies.Count - 1 do
AddHeaderItem(Cookies[I].HeaderValue, 'Set-Cookie: %s'#13#10);
{do not localize }
AddHeaderItem(DerivedFrom, 'Derived-From: %s'#13#10);
{do not localize }
if Expires > 0 then
AddHeaderItem(Format(FormatDateTime(sDat
eFormat + ' "GMT"',
{do not localize}
Expires), [DayOfWeekStr(Expires), MonthStr(Expires)]), 'Expires:
%s'#13#10); {do not localize}
if LastModified > 0 then
AddHeaderItem(Format(FormatDateTime(sDat
eFormat +
' "GMT"', LastModified), [DayOfWeekStr(LastModified),
{do not localize}
MonthStr(LastModified)]), 'Last-Modified: %s'#13#10);
{do not localize}
AddHeaderItem(Title, 'Title: %s'#13#10);
{do not localize }
AddHeaderItem(FormatAuthenticate, 'WWW-Authenticate: %s'#13#10);
{do not localize }
AddCustomHeaders(Headers);
AddHeaderItem(ContentVersion, 'Content-Version: %s'#13#10);
{do not localize }
AddHeaderItem(ContentEncoding, 'Content-Encoding: %s'#13#10);
{do not localize }
AddHeaderItem(ContentType, 'Content-Type: %s'#13#10);
{do not localize }
if (Content <> '') or (ContentStream <> nil) then
AddHeaderItem(IntToStr(ContentLength), 'Content-Length: %s'#13#10);
{do not localize }
Headers := Headers + 'Content:'#13#10#13#10;
{do not localize }
HTTPRequest.WriteHeaders(StatusCode, StatusString, Headers);
end;
if ContentStream = nil then
HTTPRequest.WriteString(Content)
else if ContentStream <> nil then
begin
SendStream(ContentStream);
ContentStream := nil; // Drop the stream
end;
FSent := True;
end;
Here is axactly what the above code does write:
======
Status: 302 Moved Temporarily
Location: http://www.easy-shop.ch
Set-Cookie: UID=363_133D3C; path=/mis30/
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"
Content-Type: text/html
Content-Length: 197
Content:
<html><title>Dokument wurde verschoben 302</title>
<body><h1>Objekt wurde verschoben</h1><hr>
Das Objekt kann <a HREF="http://www.easy-shop.ch">hier</a> gefunden
werden.<br>
<br></body></html>
======
> 2. the configuration that causes IIS6 te reploce your 302 content
What configuration do you meen exactly and how can I give it to you? I'm
using the default settings on a fresh installed Win2k3 Web Edition server.
I give you here some log I did with wfetch from the IIS Resource Kit against
IIS6.0 / IIS 5.1 / Apache 1.3 all with the same cgi web application. The
Apache Server is the only one who behaves correctly and uses my content, so
I post it at first:
**** Apache 1.3 ****
started....
WWWConnect::Connect("pc","80")\n
IP = "10.0.0.139:80"\n
source port: 1039\r\n
REQUEST: **************\n
GET /mis30/bin/srves.exe HTTP/1.1\r\n
Host: pc\r\n
Accept: */*\r\n
\r\n
RESPONSE: **************\n
HTTP/1.1 302 Moved Temporarily\r\n
Date: Fri, 22 Jul 2005 11:14:54 GMT\r\n
Server: Apache/1.3.27 (Win32)\r\n
Content: \r\n
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"\r\n
Set-Cookie: UID=352_13323D; path=/mis30/\r\n
Location: http://www.easy-shop.ch\r\n
Content-Length: 197\r\n
Content-Type: text/html\r\n
\r\n
<html><title>Dokument wurde verschoben 302</title>\r\n
<body><h1>Objekt wurde verschoben</h1><hr>\r\n
Das Objekt kann <a HREF="http://www.easy-shop.ch">hier</a> gefunden
werden.<br>\r\n
<br></body></html>\r\n
finished.
========================================
==
**** IIS 6 ****
started....
WWWConnect::Connect("localhost","80")\n
IP = "127.0.0.1:80"\n
source port: 1041\r\n
REQUEST: **************\n
GET /mis30/bin/srves.exe HTTP/1.1\r\n
Host: localhost\r\n
Accept: */*\r\n
\r\n
RESPONSE: **************\n
HTTP/1.1 302 Moved Temporarily\r\n
Content-Length: 197\r\n
Content-Type: text/html\r\n
Location: http://www.easy-shop.ch\r\n
Server: Microsoft-IIS/6.0\r\n
Set-Cookie: UID=31_133F; path=/mis30/\r\n
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"\r\n
Content: \r\n
Date: Fri, 22 Jul 2005 11:33:26 GMT\r\n
\r\n
<head><title>Document Moved</title></head>\n
<body><h1>Object Moved</h1>This document may be found <a
HREF="http://www.easy-shop.ch">here</a></body>
0x2746 Socket Error On Receive
0x2746 Socket Error On Receive
finished.
========================================
==
**** IIS 5.1 ****
started....
WWWConnect::Connect("pc","81")\n
IP = "10.0.0.139:81"\n
source port: 1045\r\n
REQUEST: **************\n
GET /mis30/bin/srves.exe HTTP/1.1\r\n
Host: pc\r\n
Accept: */*\r\n
\r\n
RESPONSE: **************\n
HTTP/1.1 302 Object Moved\r\n
Server: Microsoft-IIS/5.1\r\n
Date: Fri, 22 Jul 2005 11:46:44 GMT\r\n
Connection: close\r\n
Content-Type: text/html\r\n
Location: http://www.easy-shop.ch\r\n
Set-Cookie: UID=355_13323A; path=/mis30/\r\n
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"\r\n
Content-Length: 197\r\n
Content:\r\n
\r\n
<head><title>Document Moved</title></head>\n<body><h1>Object Moved</h1>This
document may be found <a HREF="http://www.easy-shop.ch">here</a></body>
finished.
========================================
==
You can see that the IIS 5 and 6 uses still my initial Content Length header
but not my content html. As a result of this, the content length doesn't fit
the content html. There was not a problem in IIS 5 because it did close the
connection (Connection: close Header) which IIS 6 doesn't use anymore.
I hope this information can help you to identify the problem in IIS. If you
want contact me by personal email you can do this with this email:
rolf[at]eicom.ch
Regards
Rolf
>
> I am not aware of any IIS6 behavior which replaces content of a response,
> so
> I need detailed configuration that can reproduce this. I need to know the
> Windows patch level, and as much IIS configuration as you can determine to
> reproduce this. If you do not give enough configuration detail for me to
> reproduce it, then this issue really does not exist for us to see and fix
> it.
>
> Standard disclaimer:
>
> As with any supported Microsoft product, you can call/contact PSS to
> report
> issues. However, PSS will attempt to get the same sort of information I
> just
> asked of you, and if it is insufficient or turns out to be "by-design",
> they
> may charge you and/or reject your issue due to insufficient data to take
> action.
>
> In other words -- not all bugs can be filed (they have to have enough
> information to be actionable -- otherwise, we cannot do anything about it
> because we cannot reproduce it to fix it), and not all bugs are fixed
> (this
> is what people usually do not understand -- but realize that with every
> fix
> there is cost, risk, and benefit -- and if the benefit is too
> risky/costly,
> the bug won't get fixed).
>
> --
> //David
> IIS
> http://blogs.msdn.com/David.Wang
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> //
> "Rolf" <no.email@no.com> wrote in message
> news:uF5j8lejFHA.3144@TK2MSFTNGP12.phx.gbl...
> My Webapplication returns the content and the content length in a
> redirection answer (302). Now the problem is that IIS 6 does replace that
> content from my webapplication and puts it's own redirect html content
> into
> the response. But!!! It doesn't set the Content Length to the correct size
> of its own html content!!!!
>
> As a result of this, the Content Length header has a wrong value witch
> doesnt fit the real content length. So if IE should do a redirect it waits
> forever to get all content which is smaller in this case than what my
> webapplication did return. So it waits for additional 53 bytes, which it
> never will get and a timeout occurs.
>
> Content Length of the IIS6 redirect html content is 146 but the Content
> Length header is still set to 199, which is the length I did set in my
> webapplication for my content, which is 199 bytes long.
>
> Where can we log that bug so it will be fixed?
>
> Regards
> Rolf
>
>
>
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: IIS Bug on redirect (wrong Content Length header!!!) |
 |
 |
|
|
07-24-05 01:04 PM
Hi David
1. To make it clear: I don't use a CGI script, I'm using a CGI-executable
(C++ or Delphi in my case)
2. Just curious, but what is NPH? I have never heard of that.
3. Replacing the content without to correct the content length is by
desing?! You joking right?
My CGI-.Exe gives exact ths back to IIS:
===========
Status: 302 Moved Temporarily
Location: http://www.easy-shop.ch
Set-Cookie: UID=363_133D3C; path=/mis30/
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"
Content-Type: text/html
Content-Length: 197
Content:
<html><title>Dokument wurde verschoben 302</title>
<body><h1>Objekt wurde verschoben</h1><hr>
Das Objekt kann <a HREF="http://www.easy-shop.ch">hier</a> gefunden
werden.<br>
<br></body></html>
===========
Is this so called nph? I donn't think, or? The point that IIS replaces the
content isn't the problem here. The pproblem is that IIS doesn't replace the
Content-Length header with the correct value too. That can't be by design!!!
MS own products (IE) hangs on such a wrong respone form IIS.
Regards
Rolf
"David Wang [Msft]" <someone@online.microsoft.com> schrieb im Newsbeitra
g
news:uQO4bsBkFHA.4000@TK2MSFTNGP12.phx.gbl...
> Ah, you are talking about a CGI. Is your CGI expecting NPH behavior or
> not?
>
> When you run CGI in normal mode, the Location: header (along with
> Content-Type and Status headers) is one of the CGI defined headers that
> cause IIS to do response replacement according to normal CGI semantics.
>
> Your CGI expects NPH behavior, so it needs to be named accordingly with a
> nph- prefix. This behavior is by-design.
>
> --
> //David
> IIS
> http://blogs.msdn.com/David.Wang
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> //
> "Rolf" <no.email@no.com> wrote in message
> news:%23%23rWVdrjFHA.796@TK2MSFTNGP10.phx.gbl...
> Hi David
>
> Thanks for your answer.
>
>
> It is Delphi code, it's not difficult to understand so it comes here (see
> what it exactly produces below):
>
> procedure TCGIResponse.SendRedirect(const URI: string);
> const
> sDocumentMoved = '<html><title>Dokument wurde verschoben
> 302</title>'#13#10 +
> '<body><h1>Objekt wurde verschoben</h1><hr>'#13#10 +
> 'Das Objekt kann <a HREF="%s">hier</a> gefunden werden.<br>'#13#10 +
> '<br></body></html>'#13#10;
> begin
> Location := URI;
> StatusCode := 302;
> ContentType := 'text/html'; { do not localize }
> Content := Format(sDocumentMoved, [URI]);
> SendResponse;
> end;
>
> procedure TCGIResponse.SendResponse;
> var
> StatusString: string;
> Headers: string;
> I: Integer;
>
> procedure AddHeaderItem(const Item, FormatStr: string);
> begin
> if Item <> '' then
> Headers := Headers + Format(FormatStr, [Item]);
> end;
>
> begin
> if HTTPRequest.ProtocolVersion <> '' then
> begin
> if (ReasonString <> '') and (StatusCode > 0) then
> StatusString := Format('%d %s', [StatusCode, ReasonString])
> else StatusString := '200 OK';
> {do not localize }
> AddHeaderItem(Location, 'Location: %s'#13#10);
> {do not localize }
> AddHeaderItem(Allow, 'Allow: %s'#13#10);
> {do not localize }
> for I := 0 to Cookies.Count - 1 do
> AddHeaderItem(Cookies[I].HeaderValue, 'Set-Cookie: %s'#13#10);
> {do not localize }
> AddHeaderItem(DerivedFrom, 'Derived-From: %s'#13#10);
> {do not localize }
> if Expires > 0 then
> AddHeaderItem(Format(FormatDateTime(sDat
eFormat + ' "GMT"',
> {do not localize}
> Expires), [DayOfWeekStr(Expires), MonthStr(Expires)]), 'Expires
:
> %s'#13#10); {do not localize}
>
> if LastModified > 0 then
> AddHeaderItem(Format(FormatDateTime(sDat
eFormat +
> ' "GMT"', LastModified), [DayOfWeekStr(LastModified),
> {do not localize}
> MonthStr(LastModified)]), 'Last-Modified: %s'#13#10);
> {do not localize}
> AddHeaderItem(Title, 'Title: %s'#13#10);
> {do not localize }
> AddHeaderItem(FormatAuthenticate, 'WWW-Authenticate: %s'#13#10);
> {do not localize }
> AddCustomHeaders(Headers);
> AddHeaderItem(ContentVersion, 'Content-Version: %s'#13#10);
> {do not localize }
> AddHeaderItem(ContentEncoding, 'Content-Encoding: %s'#13#10);
> {do not localize }
> AddHeaderItem(ContentType, 'Content-Type: %s'#13#10);
> {do not localize }
> if (Content <> '') or (ContentStream <> nil) then
> AddHeaderItem(IntToStr(ContentLength), 'Content-Length: %s'#13#10);
> {do not localize }
> Headers := Headers + 'Content:'#13#10#13#10;
> {do not localize }
> HTTPRequest.WriteHeaders(StatusCode, StatusString, Headers);
> end;
> if ContentStream = nil then
> HTTPRequest.WriteString(Content)
> else if ContentStream <> nil then
> begin
> SendStream(ContentStream);
> ContentStream := nil; // Drop the stream
> end;
> FSent := True;
> end;
>
> Here is axactly what the above code does write:
> ======
> Status: 302 Moved Temporarily
> Location: http://www.easy-shop.ch
> Set-Cookie: UID=363_133D3C; path=/mis30/
> P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"
> Content-Type: text/html
> Content-Length: 197
> Content:
>
> <html><title>Dokument wurde verschoben 302</title>
> <body><h1>Objekt wurde verschoben</h1><hr>
> Das Objekt kann <a HREF="http://www.easy-shop.ch">hier</a> gefunden
> werden.<br>
> <br></body></html>
> ======
>
>
>
> What configuration do you meen exactly and how can I give it to you? I'm
> using the default settings on a fresh installed Win2k3 Web Edition server.
>
> I give you here some log I did with wfetch from the IIS Resource Kit
> against
> IIS6.0 / IIS 5.1 / Apache 1.3 all with the same cgi web application. The
> Apache Server is the only one who behaves correctly and uses my content,
> so
> I post it at first:
>
> **** Apache 1.3 ****
> started....
> WWWConnect::Connect("pc","80")\n
> IP = "10.0.0.139:80"\n
> source port: 1039\r\n
> REQUEST: **************\n
> GET /mis30/bin/srves.exe HTTP/1.1\r\n
> Host: pc\r\n
> Accept: */*\r\n
> \r\n
> RESPONSE: **************\n
> HTTP/1.1 302 Moved Temporarily\r\n
> Date: Fri, 22 Jul 2005 11:14:54 GMT\r\n
> Server: Apache/1.3.27 (Win32)\r\n
> Content: \r\n
> P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"\r\n
> Set-Cookie: UID=352_13323D; path=/mis30/\r\n
> Location: http://www.easy-shop.ch\r\n
> Content-Length: 197\r\n
> Content-Type: text/html\r\n
> \r\n
> <html><title>Dokument wurde verschoben 302</title>\r\n
> <body><h1>Objekt wurde verschoben</h1><hr>\r\n
> Das Objekt kann <a HREF="http://www.easy-shop.ch">hier</a> gefunden
> werden.<br>\r\n
> <br></body></html>\r\n
> finished.
>
> ========================================
==
>
>
> **** IIS 6 ****
> started....
> WWWConnect::Connect("localhost","80")\n
> IP = "127.0.0.1:80"\n
> source port: 1041\r\n
> REQUEST: **************\n
> GET /mis30/bin/srves.exe HTTP/1.1\r\n
> Host: localhost\r\n
> Accept: */*\r\n
> \r\n
> RESPONSE: **************\n
> HTTP/1.1 302 Moved Temporarily\r\n
> Content-Length: 197\r\n
> Content-Type: text/html\r\n
> Location: http://www.easy-shop.ch\r\n
> Server: Microsoft-IIS/6.0\r\n
> Set-Cookie: UID=31_133F; path=/mis30/\r\n
> P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"\r\n
> Content: \r\n
> Date: Fri, 22 Jul 2005 11:33:26 GMT\r\n
> \r\n
> <head><title>Document Moved</title></head>\n
> <body><h1>Object Moved</h1>This document may be found <a
> HREF="http://www.easy-shop.ch">here</a></body>
> 0x2746 Socket Error On Receive
> 0x2746 Socket Error On Receive
> finished.
>
> ========================================
==
>
> **** IIS 5.1 ****
> started....
> WWWConnect::Connect("pc","81")\n
> IP = "10.0.0.139:81"\n
> source port: 1045\r\n
> REQUEST: **************\n
> GET /mis30/bin/srves.exe HTTP/1.1\r\n
> Host: pc\r\n
> Accept: */*\r\n
> \r\n
> RESPONSE: **************\n
> HTTP/1.1 302 Object Moved\r\n
> Server: Microsoft-IIS/5.1\r\n
> Date: Fri, 22 Jul 2005 11:46:44 GMT\r\n
> Connection: close\r\n
> Content-Type: text/html\r\n
> Location: http://www.easy-shop.ch\r\n
> Set-Cookie: UID=355_13323A; path=/mis30/\r\n
> P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"\r\n
> Content-Length: 197\r\n
> Content:\r\n
> \r\n
> <head><title>Document Moved</title></head>\n<body><h1>Object
> Moved</h1>This
> document may be found <a HREF="http://www.easy-shop.ch">here</a></body>
> finished.
>
> ========================================
==
>
> You can see that the IIS 5 and 6 uses still my initial Content Length
> header
> but not my content html. As a result of this, the content length doesn't
> fit
> the content html. There was not a problem in IIS 5 because it did close
> the
> connection (Connection: close Header) which IIS 6 doesn't use anymore.
>
> I hope this information can help you to identify the problem in IIS. If
> you
> want contact me by personal email you can do this with this email:
> rolf[at]eicom.ch
>
> Regards
> Rolf
>
>
>
>
>
>
>
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: IIS Bug on redirect (wrong Content Length header!!!) |
 |
 |
|
|
07-25-05 01:48 AM
Yes, your CGI is assuming NPH behavior, which you did not know about. Please
rename your CGI to NPH-<CGI-name>.exe and try again. If IIS still acts on
the Location: header, then that is something we can look at.
The normal parsed header behavior is documented and by-design. You tell the
web server to do something with the headers when you are trying to control
the headers and may conflict with what you added -- and you expect it to be
magically fixed. That will rarely happen no matter what platform/system you
are running on -- the right thing is for you to NOT tell the web server to
do anything with the headers if you intend to control the response
completely.
--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Rolf" <no.email@no.com> wrote in message
news:OGLOV%23DkFHA.3580@TK2MSFTNGP09.phx.gbl...
Hi David
1. To make it clear: I don't use a CGI script, I'm using a CGI-executable
(C++ or Delphi in my case)
2. Just curious, but what is NPH? I have never heard of that.
3. Replacing the content without to correct the content length is by
desing?! You joking right?
My CGI-.Exe gives exact ths back to IIS:
===========
Status: 302 Moved Temporarily
Location: http://www.easy-shop.ch
Set-Cookie: UID=363_133D3C; path=/mis30/
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"
Content-Type: text/html
Content-Length: 197
Content:
<html><title>Dokument wurde verschoben 302</title>
<body><h1>Objekt wurde verschoben</h1><hr>
Das Objekt kann <a HREF="http://www.easy-shop.ch">hier</a> gefunden
werden.<br>
<br></body></html>
===========
Is this so called nph? I donn't think, or? The point that IIS replaces the
content isn't the problem here. The pproblem is that IIS doesn't replace the
Content-Length header with the correct value too. That can't be by design!!!
MS own products (IE) hangs on such a wrong respone form IIS.
Regards
Rolf
"David Wang [Msft]" <someone@online.microsoft.com> schrieb im Newsbeitra
g
news:uQO4bsBkFHA.4000@TK2MSFTNGP12.phx.gbl...
> Ah, you are talking about a CGI. Is your CGI expecting NPH behavior or
> not?
>
> When you run CGI in normal mode, the Location: header (along with
> Content-Type and Status headers) is one of the CGI defined headers that
> cause IIS to do response replacement according to normal CGI semantics.
>
> Your CGI expects NPH behavior, so it needs to be named accordingly with a
> nph- prefix. This behavior is by-design.
>
> --
> //David
> IIS
> http://blogs.msdn.com/David.Wang
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> //
> "Rolf" <no.email@no.com> wrote in message
> news:%23%23rWVdrjFHA.796@TK2MSFTNGP10.phx.gbl...
> Hi David
>
> Thanks for your answer.
>
>
> It is Delphi code, it's not difficult to understand so it comes here (see
> what it exactly produces below):
>
> procedure TCGIResponse.SendRedirect(const URI: string);
> const
> sDocumentMoved = '<html><title>Dokument wurde verschoben
> 302</title>'#13#10 +
> '<body><h1>Objekt wurde verschoben</h1><hr>'#13#10 +
> 'Das Objekt kann <a HREF="%s">hier</a> gefunden werden.<br>'#13#10 +
> '<br></body></html>'#13#10;
> begin
> Location := URI;
> StatusCode := 302;
> ContentType := 'text/html'; { do not localize }
> Content := Format(sDocumentMoved, [URI]);
> SendResponse;
> end;
>
> procedure TCGIResponse.SendResponse;
> var
> StatusString: string;
> Headers: string;
> I: Integer;
>
> procedure AddHeaderItem(const Item, FormatStr: string);
> begin
> if Item <> '' then
> Headers := Headers + Format(FormatStr, [Item]);
> end;
>
> begin
> if HTTPRequest.ProtocolVersion <> '' then
> begin
> if (ReasonString <> '') and (StatusCode > 0) then
> StatusString := Format('%d %s', [StatusCode, ReasonString])
> else StatusString := '200 OK';
> {do not localize }
> AddHeaderItem(Location, 'Location: %s'#13#10);
> {do not localize }
> AddHeaderItem(Allow, 'Allow: %s'#13#10);
> {do not localize }
> for I := 0 to Cookies.Count - 1 do
> AddHeaderItem(Cookies[I].HeaderValue, 'Set-Cookie: %s'#13#10);
> {do not localize }
> AddHeaderItem(DerivedFrom, 'Derived-From: %s'#13#10);
> {do not localize }
> if Expires > 0 then
> AddHeaderItem(Format(FormatDateTime(sDat
eFormat + ' "GMT"',
> {do not localize}
> Expires), [DayOfWeekStr(Expires), MonthStr(Expires)]), 'Expires
:
> %s'#13#10); {do not localize}
>
> if LastModified > 0 then
> AddHeaderItem(Format(FormatDateTime(sDat
eFormat +
> ' "GMT"', LastModified), [DayOfWeekStr(LastModified),
> {do not localize}
> MonthStr(LastModified)]), 'Last-Modified: %s'#13#10);
> {do not localize}
> AddHeaderItem(Title, 'Title: %s'#13#10);
> {do not localize }
> AddHeaderItem(FormatAuthenticate, 'WWW-Authenticate: %s'#13#10);
> {do not localize }
> AddCustomHeaders(Headers);
> AddHeaderItem(ContentVersion, 'Content-Version: %s'#13#10);
> {do not localize }
> AddHeaderItem(ContentEncoding, 'Content-Encoding: %s'#13#10);
> {do not localize }
> AddHeaderItem(ContentType, 'Content-Type: %s'#13#10);
> {do not localize }
> if (Content <> '') or (ContentStream <> nil) then
> AddHeaderItem(IntToStr(ContentLength), 'Content-Length: %s'#13#10);
> {do not localize }
> Headers := Headers + 'Content:'#13#10#13#10;
> {do not localize }
> HTTPRequest.WriteHeaders(StatusCode, StatusString, Headers);
> end;
> if ContentStream = nil then
> HTTPRequest.WriteString(Content)
> else if ContentStream <> nil then
> begin
> SendStream(ContentStream);
> ContentStream := nil; // Drop the stream
> end;
> FSent := True;
> end;
>
> Here is axactly what the above code does write:
> ======
> Status: 302 Moved Temporarily
> Location: http://www.easy-shop.ch
> Set-Cookie: UID=363_133D3C; path=/mis30/
> P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"
> Content-Type: text/html
> Content-Length: 197
> Content:
>
> <html><title>Dokument wurde verschoben 302</title>
> <body><h1>Objekt wurde verschoben</h1><hr>
> Das Objekt kann <a HREF="http://www.easy-shop.ch">hier</a> gefunden
> werden.<br>
> <br></body></html>
> ======
>
>
>
> What configuration do you meen exactly and how can I give it to you? I'm
> using the default settings on a fresh installed Win2k3 Web Edition server.
>
> I give you here some log I did with wfetch from the IIS Resource Kit
> against
> IIS6.0 / IIS 5.1 / Apache 1.3 all with the same cgi web application. The
> Apache Server is the only one who behaves correctly and uses my content,
> so
> I post it at first:
>
> **** Apache 1.3 ****
> started....
> WWWConnect::Connect("pc","80")\n
> IP = "10.0.0.139:80"\n
> source port: 1039\r\n
> REQUEST: **************\n
> GET /mis30/bin/srves.exe HTTP/1.1\r\n
> Host: pc\r\n
> Accept: */*\r\n
> \r\n
> RESPONSE: **************\n
> HTTP/1.1 302 Moved Temporarily\r\n
> Date: Fri, 22 Jul 2005 11:14:54 GMT\r\n
> Server: Apache/1.3.27 (Win32)\r\n
> Content: \r\n
> P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"\r\n
> Set-Cookie: UID=352_13323D; path=/mis30/\r\n
> Location: http://www.easy-shop.ch\r\n
> Content-Length: 197\r\n
> Content-Type: text/html\r\n
> \r\n
> <html><title>Dokument wurde verschoben 302</title>\r\n
> <body><h1>Objekt wurde verschoben</h1><hr>\r\n
> Das Objekt kann <a HREF="http://www.easy-shop.ch">hier</a> gefunden
> werden.<br>\r\n
> <br></body></html>\r\n
> finished.
>
> ========================================
==
>
>
> **** IIS 6 ****
> started....
> WWWConnect::Connect("localhost","80")\n
> IP = "127.0.0.1:80"\n
> source port: 1041\r\n
> REQUEST: **************\n
> GET /mis30/bin/srves.exe HTTP/1.1\r\n
> Host: localhost\r\n
> Accept: */*\r\n
> \r\n
> RESPONSE: **************\n
> HTTP/1.1 302 Moved Temporarily\r\n
> Content-Length: 197\r\n
> Content-Type: text/html\r\n
> Location: http://www.easy-shop.ch\r\n
> Server: Microsoft-IIS/6.0\r\n
> Set-Cookie: UID=31_133F; path=/mis30/\r\n
> P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"\r\n
> Content: \r\n
> Date: Fri, 22 Jul 2005 11:33:26 GMT\r\n
> \r\n
> <head><title>Document Moved</title></head>\n
> <body><h1>Object Moved</h1>This document may be found <a
> HREF="http://www.easy-shop.ch">here</a></body>
> 0x2746 Socket Error On Receive
> 0x2746 Socket Error On Receive
> finished.
>
> ========================================
==
>
> **** IIS 5.1 ****
> started....
> WWWConnect::Connect("pc","81")\n
> IP = "10.0.0.139:81"\n
> source port: 1045\r\n
> REQUEST: **************\n
> GET /mis30/bin/srves.exe HTTP/1.1\r\n
> Host: pc\r\n
> Accept: */*\r\n
> \r\n
> RESPONSE: **************\n
> HTTP/1.1 302 Object Moved\r\n
> Server: Microsoft-IIS/5.1\r\n
> Date: Fri, 22 Jul 2005 11:46:44 GMT\r\n
> Connection: close\r\n
> Content-Type: text/html\r\n
> Location: http://www.easy-shop.ch\r\n
> Set-Cookie: UID=355_13323A; path=/mis30/\r\n
> P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"\r\n
> Content-Length: 197\r\n
> Content:\r\n
> \r\n
> <head><title>Document Moved</title></head>\n<body><h1>Object
> Moved</h1>This
> document may be found <a HREF="http://www.easy-shop.ch">here</a></body>
> finished.
>
> ========================================
==
>
> You can see that the IIS 5 and 6 uses still my initial Content Length
> header
> but not my content html. As a result of this, the content length doesn't
> fit
> the content html. There was not a problem in IIS 5 because it did close
> the
> connection (Connection: close Header) which IIS 6 doesn't use anymore.
>
> I hope this information can help you to identify the problem in IIS. If
> you
> want contact me by personal email you can do this with this email:
> rolf[at]eicom.ch
>
> Regards
> Rolf
>
>
>
>
>
>
>
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: IIS Bug on redirect (wrong Content Length header!!!) |
 |
 |
|
|
07-25-05 01:18 PM
David
I still disagree! Replacing the content without the correct content length
is not correct!!! If you replace something in my response, than do it so
that the response is still correct. The Content and Content Length header
are to use together and if your replace one, the other must also be
replaced. Is that such difficult? It's ok for me that IIS does replace the
content, but it shoiuld do it correct and not in a way that MS IE has
problems with it. FYI: Mozilla and Opera don't have a problem with that
incorrect Content Length header, as they simply ignoring the content, as
they do a redirect.
My CGI is not specific to IIS. It works with any INet server
(Netscape,Apache,...). Not returnning the headers and content may not work
on any other INet server. As I did write in Apache it is done correctly.
There are hunderts of custom webdesign out there whitch use my CGI. As such
it isnt' relay an option to rename the exe, as it has to much impact for all
my customers around the world. And all that to workaround a wrong IIS
behaviour? No!!!
At the moment I add a Connection Close header to my response whitch does
solve the problem and as this was what IIS 5 did.
Regards
Rolf
"David Wang [Msft]" <someone@online.microsoft.com> schrieb im Newsbeitra
g
news:Obt33tKkFHA.2916@TK2MSFTNGP14.phx.gbl...
> Yes, your CGI is assuming NPH behavior, which you did not know about.
> Please
> rename your CGI to NPH-<CGI-name>.exe and try again. If IIS still acts on
> the Location: header, then that is something we can look at.
>
> The normal parsed header behavior is documented and by-design. You tell
> the
> web server to do something with the headers when you are trying to control
> the headers and may conflict with what you added -- and you expect it to
> be
> magically fixed. That will rarely happen no matter what platform/system
> you
> are running on -- the right thing is for you to NOT tell the web server to
> do anything with the headers if you intend to control the response
> completely.
>
> --
> //David
> IIS
> http://blogs.msdn.com/David.Wang
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> //
> "Rolf" <no.email@no.com> wrote in message
> news:OGLOV%23DkFHA.3580@TK2MSFTNGP09.phx.gbl...
> Hi David
>
> 1. To make it clear: I don't use a CGI script, I'm using a CGI-executable
> (C++ or Delphi in my case)
> 2. Just curious, but what is NPH? I have never heard of that.
> 3. Replacing the content without to correct the content length is by
> desing?! You joking right?
>
> My CGI-.Exe gives exact ths back to IIS:
>
> ===========
> Status: 302 Moved Temporarily
> Location: http://www.easy-shop.ch
> Set-Cookie: UID=363_133D3C; path=/mis30/
> P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"
> Content-Type: text/html
> Content-Length: 197
> Content:
>
> <html><title>Dokument wurde verschoben 302</title>
> <body><h1>Objekt wurde verschoben</h1><hr>
> Das Objekt kann <a HREF="http://www.easy-shop.ch">hier</a> gefunden
> werden.<br>
> <br></body></html>
> ===========
>
> Is this so called nph? I donn't think, or? The point that IIS replaces the
> content isn't the problem here. The pproblem is that IIS doesn't replace
> the
> Content-Length header with the correct value too. That can't be by
> design!!!
> MS own products (IE) hangs on such a wrong respone form IIS.
>
> Regards
> Rolf
>
>
> "David Wang [Msft]" <someone@online.microsoft.com> schrieb im Newsbeit
rag
> news:uQO4bsBkFHA.4000@TK2MSFTNGP12.phx.gbl...
>
>
>
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: IIS Bug on redirect (wrong Content Length header!!!) |
 |
 |
|
|
07-25-05 11:06 PM
Hello,
I would like to chime in on this.
I don't think you have understood the difference between NPH (No Parsed
Headers) and parsed headers. You want your CGI application to take care
of everything and communicate directly to the client, but you fail to
tell IIS about this, hence your CGI application assumes NPH behavior.
According to the CGI spcification[1], NPH CGI applications should start
their name with "nph-"[2] but you fail to do this. This is also how the
webserver identifies your CGI application as NPH.
c
I think it is up to you if you decide to not follow the specification,
and to not tell IIS to not parse the headers returned by this CGI
application. But in my opinion, you should configure the webserver
(which in this case means renaming the CGI executable) appropriate.
[1] http://hoohoo.ncsa.uiuc.edu/cgi/interface.html
[2] http://hoohoo.ncsa.uiuc.edu/cgi/out.html
--
Regards,
Kristofer Gafvert (IIS MVP)
http://www.gafvert.info - Articles and help
Rolf wrote:
[vbcol=seagreen]
> David
>
> I still disagree! Replacing the content without the correct content
> length is not correct!!! If you replace something in my response,
> than do it so that the response is still correct. The Content and
> Content Length header are to use together and if your replace one,
> the other must also be replaced. Is that such difficult? It's ok for
> me that IIS does replace the content, but it shoiuld do it correct
> and not in a way that MS IE has problems with it. FYI: Mozilla and
> Opera don't have a problem with that incorrect Content Length header,
> as they simply ignoring the content, as they do a redirect.
>
> My CGI is not specific to IIS. It works with any INet server
> (Netscape,Apache,...). Not returnning the headers and content may not
> work on any other INet server. As I did write in Apache it is done
> correctly. There are hunderts of custom webdesign out there whitch
> use my CGI. As such it isnt' relay an option to rename the exe, as it
> has to much impact for all my customers around the world. And all
> that to workaround a wrong IIS behaviour? No!!!
>
> At the moment I add a Connection Close header to my response whitch
> does solve the problem and as this was what IIS 5 did.
>
> Regards
> Rolf
>
> "David Wang [Msft]" <someone@online.microsoft.com> schrieb im
> Newsbeitrag news:Obt33tKkFHA.2916@TK2MSFTNGP14.phx.gbl...
> Newsbeitrag
> werden.<br>'#13#10 + >> '<br></body></html>'#13#10;
> 'Expires:
> %s'#13#10);
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: IIS Bug on redirect (wrong Content Length header!!!) |
 |
 |
|
|
07-25-05 11:06 PM
And regarding the issue where Content-Length is not changed while the
body is, it seems to be a bug (i do not recognise any Content header so
i assume you were talking about the http body).
--
Regards,
Kristofer Gafvert (IIS MVP)
http://www.gafvert.info - Articles and help
Kristofer Gafvert [MVP] wrote:
> Hello,
>
> I would like to chime in on this.
>
> I don't think you have understood the difference between NPH (No
> Parsed Headers) and parsed headers. You want your CGI application to
> take care of everything and communicate directly to the client, but
> you fail to tell IIS about this, hence your CGI application assumes
> NPH behavior.
> According to the CGI spcification[1], NPH CGI applications should
> start their name with "nph-"[2] but you fail to do this. This is also
> how the webserver identifies your CGI application as NPH.
> c
> I think it is up to you if you decide to not follow the specification,
> and to not tell IIS to not parse the headers returned by this CGI
> application. But in my opinion, you should configure the webserver
> (which in this case means renaming the CGI executable) appropriate.
>
> [1] http://hoohoo.ncsa.uiuc.edu/cgi/interface.html
> [2] http://hoohoo.ncsa.uiuc.edu/cgi/out.html
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: IIS Bug on redirect (wrong Content Length header!!!) |
 |
 |
|
|
07-25-05 11:06 PM
> The normal parsed header behavior is documented and by-design. You tell
the
> web server to do something with the headers when you are trying to control
> the headers and may conflict with what you added -- and you expect it to
be
> magically fixed. That will rarely happen no matter what platform/system
you
> are running on -- the right thing is for you to NOT tell the web server to
> do anything with the headers if you intend to control the response
> completely.
I have to agree here with Rolf. If IIS is changing the content of the
response, it should also update the content-length header. As far as I can
see, Rolf has no problem with IIS change the content of the response, only
that it is replacing th content and not the content-length. In my eyes that
is a bug...
Regards,
Tjipke
[ Post a follow-up to this message ]
|
|
|
 |
|
|
|
|
Sponsored Links |
 |
 |
|
|
 |
All times are GMT. The time now is 06:17 AM. |
 |
|
|
 |
|
 |
|
|
 |
|
| |
|