Ticket #2487 (closed defect: fixed)
"ValueError: need more than 1 value to unpack" in parse_mime_type with some Accept headers
| Reported by: | corvus | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | irrespective |
| Component: | TurboGears | Version: | trunk |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Hi,
The Accept header "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2", which I have seen in the wild (even though it doesn't appear to be valid) causes a ValueError?. It looks like parse_mime_type is expecting a '/', but it doesn't show up with the single '*' in that line.
It should probably ignore entries without a slash, or, perhaps more generously, treat them as [value]/*.
To reproduce:
telnet localhost 8080 GET /feed/rss2_0 HTTP/1.1 Host: localhost Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Change History
Note: See
TracTickets for help on using
tickets.
I think this is the same as #2433