Select the headers from the request that need to be included in the StringToSign.
(self, request)
| 240 | return sig |
| 241 | |
| 242 | def headers_to_sign(self, request): |
| 243 | """ |
| 244 | Select the headers from the request that need to be included |
| 245 | in the StringToSign. |
| 246 | """ |
| 247 | header_map = HTTPHeaders() |
| 248 | for name, value in request.headers.items(): |
| 249 | lname = name.lower() |
| 250 | if lname not in SIGNED_HEADERS_BLACKLIST: |
| 251 | header_map[lname] = value |
| 252 | if 'host' not in header_map: |
| 253 | # TODO: We should set the host ourselves, instead of relying on our |
| 254 | # HTTP client to set it for us. |
| 255 | header_map['host'] = _host_from_url(request.url) |
| 256 | return header_map |
| 257 | |
| 258 | def canonical_query_string(self, request): |
| 259 | # The query string can come from two parts. One is the |