You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into an issue using a local copy of drf-extensions, and I was just going to suggest a fix when I found #197 had fixed the issue by stripping quotes from etags:
if res_etag and if_none_match:
etags = [etag.strip('"') for etag in etags]
return res_etag in etags or '*' in etags
I was going to suggest this, which is a little bit easier to read IMO:
if res_etag and if_none_match:
return quote_etag(res_etag) in etags or '*' in etags
I agree with your suggestion to fix is_if_match_failed. I spent hours having "Precondition Failed" on a PUT request. This means both functions require striped etags therefore, they should be done out side both functions, probably before calling both functions or parse_etags function should return striped tags ?
I am not sure what will be consequences given 1.11 documentation read as:
Changed in Django 1.11:
In older versions, the return value from etag_func() was interpreted as the unquoted part of the ETag. That prevented the use of weak ETags, which have the format W/"". The return value is now expected to be an ETag as defined by the specification (including the quotes), although the unquoted format is also accepted for backwards compatibility.
Hey folks 👋
I ran into an issue using a local copy of drf-extensions, and I was just going to suggest a fix when I found #197 had fixed the issue by stripping quotes from etags:
I was going to suggest this, which is a little bit easier to read IMO:
I presume the fix from #197 should also have been applied to
is_if_match_failed
too.The text was updated successfully, but these errors were encountered: