Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Ignore invalid mime wildcards in MIMEAccept #83
The current implementation of MIMEAccept will happily parse malformed wildcard strings like "image/pn*" at parse time, but then trigger an AssertionError during matching:
This patch changes MIMEAccept.parse to filter out these invalid values so that client-provided data cannot trigger an assertion.
Also worth noting that we've seen this occasionally in the wild, with user-agents apparently sending an invalid Accept header: