Tcl Library Source Code

View Ticket
Login
Ticket UUID: d736dc95eaeddbf424b0d10a33e18b54cd078657
Title: httpd: bugs found by the new tests
Type: Bug Version: trunk
Submitter: serhiy.storchaka Created on: 2026-11-21 20:57:46
Subsystem: None Assigned To: nobody
Priority: 5 Medium Severity: Important
Status: Open Last Modified: 2026-11-21 20:57:46
Resolution: None Closed By: nobody
    Closed on:
Description:

The bugs below were found by the tests in branch tests-httpd; each is covered by a test with the knownBug constraint (httpd-api-2.2, httpd-api-3.10, httpd-api-3.14, httpd-api-5.18). All of them occur with Tcl 8.6 and 9.1.

  • content.redirect does not redirect: for a URI added with {mixin {reply ::httpd::content.redirect} LOCATION /new} the reply has an empty Location header, and REDIRECT_CODE 302 is ignored (the reply is always 301). The class reads LOCATION and REDIRECT_CODE in its reset method, but dispatch calls reset before it applies the settings of the URI. (httpd-api-3.10, httpd-api-3.14)
  • The status line of content.redirect is HTTP/1.0 301 {Moved Permanently}, with braces: reset sets Status to [list $code [my http_code_string $code]]. (httpd-api-3.10)
  • With port 0, port_listening returns 0 instead of the port actually allocated by the system; start stores the configured port, not the one of the server socket. The same value is passed as SERVER_PORT. (httpd-api-2.2)
  • timeOutCheck never sends the 408 reply: dispatched_time is set with clock milliseconds, but compared with clock seconds, so the difference is always negative. (httpd-api-5.18)

Already reported: [c0e70192dd].