From: SourceForge.net <no...@so...> - 2007-02-23 00:57:10
|
Bugs item #1663763, was opened at 2007-02-19 19:24 Message generated for change (Comment added) made by sdeasey You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=719006&aid=1663763&group_id=130646 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: naviserver - libnsd, libnsthread, nsd Group: Bug Status: Open Resolution: None Priority: 5 Private: No Submitted By: Michael A. Cleverly (cleverly) >Assigned to: Stephen Deasey (sdeasey) Summary: /*.tcl files always returned w/ Transfer-Encoding: chunked? Initial Comment: AFAICT (with enabletclpages on), any *.tcl page under the documentroot will have its content returned to the user with a Transfer-Encoding: chunked, regardless of whether the request is HTTP/0.9, HTTP/1.0 or HTTP/1.1. For modern browsers this isn't an issue as they'll generally always make (and understand a response in) HTTP/1.1 requests. But for some clients (i.e., Lynx, wget, etc.) that don't expect an HTTP/1.1 encoded reply the transfer-encoding byte ranges end up being interpreted as part of the request body. For example, I have the following one line script in $NSHOME/pages/hello.tcl: ns_return 200 text/plain "Hello World" ## HTTP/1.1 request (expected result) michael@ned:/usr/local/ns/pages$ telnet localhost 80 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. GET /hello.tcl HTTP/1.1 Host: localhost Connection: close HTTP/1.1 200 OK MIME-Version: 1.0 Accept-Ranges: bytes Date: Mon, 19 Feb 2007 19:06:01 GMT Server: NaviServer/4.99.2 Content-Type: text/plain; charset=utf-8 Transfer-Encoding: chunked Connection: close b Hello World 0 Connection closed by foreign host. ## HTTP/1.0 request (unexpected result) michael@ned:/usr/local/ns/pages$ telnet localhost 80 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. GET /hello.tcl HTTP/1.0 Connection: close HTTP/1.1 200 OK MIME-Version: 1.0 Accept-Ranges: bytes Date: Mon, 19 Feb 2007 19:06:14 GMT Server: NaviServer/4.99.2 Content-Type: text/plain; charset=utf-8 Transfer-Encoding: chunked Connection: close b Hello World 0 Connection closed by foreign host. ## HTTP/0.9 request (unexpected result; do we need ## to even support HTTP/0.9 really?) michael@ned:/usr/local/ns/pages$ telnet localhost 80 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. GET /hello.tcl b Hello World 0 Connection closed by foreign host. ## From Lynx (unexpected result) michael@ned:/usr/local/ns/pages$ lynx -dump http://localhost/hello.tcl b Hello World 0 (All of the above tested with Naviserver compiled from CVS HEAD as of Feb 7th, 2007 & Tcl 8.4.14 under Debian.) ---------------------------------------------------------------------- >Comment By: Stephen Deasey (sdeasey) Date: 2007-02-23 00:57 Message: Logged In: YES user_id=87254 Originator: NO Current status: All responses from Tcl/ADP scripts to HTTP/1.1 clients will be sent in the chunked transfer encoding. All responses from Tcl/ADP scripts to HTTP/1.0 clients will have their connections close. No keep-alives. Static pages work as expected. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=719006&aid=1663763&group_id=130646 |