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: Open Last Modified: 2008-12-18 09:30:07
Resolution: None Closed By:
    Closed on:
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 {}
        ...........
        ..........