Tcl Library Source Code

View Ticket
Login
Ticket UUID: 2444762
Title: Mozilla 3.x breaks ncgi::nvlist
Type: Bug Version: None
Submitter: nobody Created on: 2008-12-18 09:30:07
Subsystem: ncgi Assigned To: welch
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2026-11-21 08:42:17
Resolution: Fixed Closed By: serhiy.storchaka
    Closed on: 2026-11-21 08:42:16
Description:
Somewhere in the 3.x release Mozilla appends a character set on GET requests, which in turn breaks the parsing of env(CONTENT_TYPE), which in turns makes tclhttpd return "dont know how to handle "application/x-www-form-urlencoded; charset=XXX""

This hack bypasses it, but maybe there's a better way to do it...

proc ::ncgi::nvlist {} {
    set query [query]
    set type  [type]
    #Quick hack by nikos to overcome Mozilla 3.x which appends charset=xxx to env(CONTENT_TYPE)
    # returning a list, e.g. application/x-www-form-urlencoded; charset=UTF-8
     if {[string match "*;"  [lindex $query 0]]} {
# set type "application/x-www-form-urlencoded"
set type "[lindex $query 0]"
set type "[lindex [split $type ";"] 0]"
} else {
}
    #end nikos
    switch -glob -- $type {
"" -
text/xml* -
application/x-www-form-urlencoded* -
application/x-www-urlencoded* {
    set result {}
        ...........
        ..........
User Comments: serhiy.storchaka added on 2026-11-21 08:42:17:

ncgi 1.3 and earlier rejected a urlencoded Content-Type followed by "; charset=..." with "Unknown Content-Type". That was fixed by [bd21455bc5] (ncgi 1.3.1, Tcllib 1.9), see also [1116123fff]. Current ncgi parses such a GET or POST request correctly (verified: ncgi 1.3 fails, trunk works). The "dont know how to handle" message in the report does not come from ncgi. Closing; please reopen with details if it still happens with a current ncgi.