#5791: Conditional get decorator -------------------------------------------------+-------------------------- Reporter: man...@softwaremaniacs.org | Owner: nobody Status: new | Milestone: Component: HTTP handling | Version: SVN Resolution: | Keywords: Stage: Accepted | Has_patch: 1 Needs_docs: 0 | Needs_tests: 0 Needs_better_patch: 0 | -------------------------------------------------+-------------------------- Comment (by mmalone):
There's a (rather trivial) bug in the latest patch. According to the HTTP spec, ETags are opaque strings. The only requirement is that they must be quoted. The current diff does a simple split on the comma character, but this breaks things if the ETag contains a comma. I'd submit a new diff and add a test, but I don't have a django dev environment setup at the moment. The fix should be simple enough, instead of doing: {{{ if_none_match = [e.strip() for e in if_none_match.split(',')] }}} do this: {{{ if_none_match = re.findall('(?:W/)?"[^"]*"', if_none_match) }}} Note that there's no check that the quoted strings are comma-separated. I think that's ok -- the spec says they have to be comma separated, and if they're not then the result is undefined. Relevant spec info is here: http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11 -- Ticket URL: <http://code.djangoproject.com/ticket/5791#comment:10> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---