~ubuntu-branches/ubuntu/raring/tcl8.5/raring

« back to all changes in this revision

Viewing changes to library/http/http.tcl

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2011-12-20 18:16:54 UTC
  • mfrom: (11.2.3 sid)
  • Revision ID: package-import@ubuntu.com-20111220181654-ucrvquqz66e1dv80
Tags: 8.5.11-1ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Don't use tcl itself to install things when building, to allow for
    cross-building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
package require Tcl 8.4
12
12
# Keep this in sync with pkgIndex.tcl and with the install directories in
13
13
# Makefiles
14
 
package provide http 2.7.6
 
14
package provide http 2.7.7
15
15
 
16
16
namespace eval http {
17
17
    # Allow resourcing to not clobber existing data
674
674
            puts $sock "Proxy-Connection: Keep-Alive"
675
675
        }
676
676
        set accept_encoding_seen 0
 
677
        set content_type_seen 0
677
678
        foreach {key value} $state(-headers) {
678
679
            if {[string equal -nocase $key "host"]} {
679
680
                continue
681
682
            if {[string equal -nocase $key "accept-encoding"]} {
682
683
                set accept_encoding_seen 1
683
684
            }
 
685
            if {[string equal -nocase $key "content-type"]} {
 
686
                set content_type_seen 1
 
687
            }
684
688
            set value [string map [list \n "" \r ""] $value]
685
689
            set key [string trim $key]
686
690
            if {[string equal -nocase $key "content-length"]} {
729
733
        # response.
730
734
 
731
735
        if {$isQuery || $isQueryChannel} {
732
 
            puts $sock "Content-Type: $state(-type)"
 
736
            if {!$content_type_seen} {
 
737
                puts $sock "Content-Type: $state(-type)"
 
738
            }
733
739
            if {!$contDone} {
734
740
                puts $sock "Content-Length: $state(querylength)"
735
741
            }