Folded headers can cause 503 responses, or even no response at all
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Confirmed
|
Medium
|
Unassigned |
Bug Description
To repro:
$ curl -v http://
* Hostname was NOT found in DNS cache
* Trying 127.0.0.1...
* Connected to saio (127.0.0.1) port 8090 (#0)
> POST /v1/AUTH_
> User-Agent: curl/7.35.0
> Host: saio:8090
> Accept: */*
> x-object-
> do: multiline?
>
< HTTP/1.1 503 Service Unavailable
< Content-Length: 118
< Content-Type: text/html; charset=UTF-8
< X-Trans-Id: txafd7c2fb28fa4
< X-Openstack-
< Date: Wed, 28 Feb 2018 13:18:36 GMT
<
* Connection #0 to host saio left intact
<html><h1>Service Unavailable<
Proxy has tracebacks like
Trying to POST /AUTH_test/c/obj:
Traceback (most recent call last):
File "/vagrant/
headers=
File "/vagrant/
ipaddr, port, method, path, headers, query_string, ssl)
File "/vagrant/
conn.
File "/usr/lib/
raise ValueError('Invalid header name %r' % (header,))
ValueError: Invalid header name ' Do' (txn: tx9d9e4455ded54
Even more fun is when your folded headers *don't* have a colon:
$ curl -v http://
* Hostname was NOT found in DNS cache
* Trying 127.0.0.1...
* Connected to saio (127.0.0.1) port 8090 (#0)
> POST /v1/AUTH_test/c/obj HTTP/1.1
> User-Agent: curl/7.35.0
> Host: saio:8090
> Accept: */*
> x-object-
> do
> multiline?
>
* Empty reply from server
* Connection #0 to host saio left intact
curl: (52) Empty reply from server
Proxy says
Feb 28 13:22:14 saio proxy-server: STDERR: Traceback (most recent call last):
Feb 28 13:22:14 saio proxy-server: STDERR: File "/usr/local/
Feb 28 13:22:14 saio proxy-server: STDERR: func(*args, **kwargs)
Feb 28 13:22:14 saio proxy-server: STDERR: File "/usr/local/
Feb 28 13:22:14 saio proxy-server: STDERR: proto._
Feb 28 13:22:14 saio proxy-server: STDERR: File "/usr/lib/
Feb 28 13:22:14 saio proxy-server: STDERR: self.handle()
Feb 28 13:22:14 saio proxy-server: STDERR: File "/usr/lib/
Feb 28 13:22:14 saio proxy-server: STDERR: self.handle_
Feb 28 13:22:14 saio proxy-server: STDERR: File "/usr/local/
Feb 28 13:22:14 saio proxy-server: STDERR: self.environ = self.get_environ()
Feb 28 13:22:14 saio proxy-server: STDERR: File "/usr/local/
Feb 28 13:22:14 saio proxy-server: STDERR: env['headers_raw'] = headers_raw = tuple((k, v.strip()) for k, v in headers)
Feb 28 13:22:14 saio proxy-server: STDERR: File "/usr/local/
Feb 28 13:22:14 saio proxy-server: STDERR: env['headers_raw'] = headers_raw = tuple((k, v.strip()) for k, v in headers)
Feb 28 13:22:14 saio proxy-server: STDERR: ValueError: need more than 1 value to unpack
Changed in swift: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
RFC 7230 deprecates folded headers; see section 3.2.4.
I'd be fine with not adding more code to support a deprecated bit of RFC 2616.