         default:
             break
         }
-        
+
         return request
     }
 }

                request.url = URL(string: urlString)!
            }
        }
        
        switch request.operation {
        case "CreateBucket":
            var xml = ""


    public func chain(request: AWSRequest) throws -> AWSRequest {
        var request = request

        var paths = request.url.path.components(separatedBy: "/").filter({ $0 != "" })
        if paths.count == 0 {
            return request
        }

        switch request.httpMethod.lowercased() {
        case "get":
            let query = request.url.query != nil ? "?\(request.url.query!)" : ""
            let domain: String
            if let host = request.url.host, host.contains("amazonaws.com") {
                domain = host
            } else {
                let port = request.url.port == nil ? "" : ":\(request.url.port!)"
                domain = request.url.host!+port
