Tk Library Source Code

View Ticket
Login
Ticket UUID: 3496110
Title: ::S3 missing "Host:" header
Type: Patch Version: None
Submitter: samoconnor Created on: 2012-03-01 22:18:55
Subsystem: amazon-s3 Assigned To: aku
Priority: 5 Medium Severity: Minor
Status: Deleted Last Modified: 2013-06-06 18:05:24
Resolution: Not Applicable Here Closed By: aku
    Closed on: 2013-06-06 18:05:24
Description:
::S3 does not send a "Host:" header.
This causes "HTTP/1.1 400 Bad Request" to be returned by some transparent proxies.
(e.g. when using Telstra 3G through the telstra.iph APN).

The patch below sets the host header.

--- /System/Library/Tcl/tcllib1.12/amazon-s3/S3.tcl.orig2012-02-25 15:32:45.000000000 +1100
+++ /System/Library/Tcl/tcllib1.12/amazon-s3/S3.tcl2012-03-02 09:13:07.000000000 +1100
@@ -252,6 +252,7 @@
     if {${content-type} != ""} {
 dict set headers content-type ${content-type}
     }
+    dict set headers host s3.amazonaws.com 
     set xamz ""
     foreach key [lsort [dict keys $headers x-amz-*]] {
 # Assume each is seen only once, for now, and is canonical already.