| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks very much for the patch!
Sorry, something went wrong.
Appreciate the preview review so I can address requested changes before writing system tests. |
Sorry, something went wrong.
|
PR feedback addressed. Still need to add system tests. Hoping to find some time tonight. |
Sorry, something went wrong.
| if value is not None: | ||
| if isinstance(value, str): | ||
| value = [value] | ||
| headers[header_name] = ", ".join(value) |
There was a problem hiding this comment.
It seems to me (though I'm not a spec expert) that the GCS API isn't following spec putting quotes around the etag values. E.g. If-None-Match: COKaz4vVzfECEAE= works as intended but If-None-Match: "COKaz4vVzfECEAE=" does not. That said, the response header is also not quoted as it apparently should be etag: COKaz4vVzfECEAE= vs expected etag: "COKaz4vVzfECEAE=". Referencing this and this.
Sorry, something went wrong.
There was a problem hiding this comment.
Hmm, maybe its just the display layers or something (using Chrome dev tools and curl). Wikipedia does the same thing.
Sorry, something went wrong.
There was a problem hiding this comment.
microsoft.com has it quoted 🤔
Sorry, something went wrong.
There was a problem hiding this comment.
RFC 7232 is the actual authoritative spec for conditional HTTP requests: If-Match and If-None-Match. The Collected ABNF appendix does indeed seem to require the double quote.
The GCS docs for the ETag header show the quotes as well.
Sorry, something went wrong.
There was a problem hiding this comment.
Yep, all the examples in the spec are also quoted. Fun times. Definitely out of scope for this PR. Just wanted to call it out. I would think the etag itself should have the quotes (i.e. blob.etag = '"Csdlei="'), so then this code would still function correctly. Of course getting etags quoted would be a far larger change spanning the backend, possibly ESF, and probably a fair amount of Hyrum's law.
It just stood out to me because I ran into a similar problem implementing the UI for BigQuery, which also doesn't follow the etag spec. In the end it meant we couldn't cache tables in the UI. But we also couldn't change the API without risking breaking clients. I'll leave it up to you if you want to file an internal ticket for that.
Sorry, something went wrong.
Sorry, something went wrong.
|
I added two system tests. The first for the client as requested. The second for blob crud modeled after generation crud (but without write operations). There wasn't an existing system test for bucket metageneration stuff, so I didn't add one there for etags. Please let me know if there are any other tests you would like to see added. I'm removing draft status as this PR is now complete from my perspective. |
Sorry, something went wrong.
|
FYI I ran the system tests for 2.7 and caught a bug in the etag helper (instance check for str doesn't work for unicode type in 2.7) that the unit tests didn't catch (because they don't round trip the etag). Fixed by using six.string_types. |
Sorry, something went wrong.
|
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request. Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project). ℹ️ Googlers: Go here for more info. |
Sorry, something went wrong.
|
Thanks, again, @daniellehanks for your effort! |
Sorry, something went wrong.
Support conditional requests based on ETag for read operations (`reload`, `exists`, `download_*`). My own testing seems to indicate that the JSON API does not support ETag If-Match/If-None-Match headers on modify requests (`patch`, `delete`, etc.), please correct me if I am mistaken. This part two of googleapis#451. Part one in googleapis#488. Fixes googleapis#451 🦕
Support conditional requests based on ETag for read operations (`reload`, `exists`, `download_*`). My own testing seems to indicate that the JSON API does not support ETag If-Match/If-None-Match headers on modify requests (`patch`, `delete`, etc.), please correct me if I am mistaken. This part two of googleapis#451. Part one in googleapis#488. Fixes googleapis#451 🦕
| Back | FazBrowse Home | New Git URL |
Support conditional requests based on ETag for read operations (reload, exists, download_*). My own testing seems to indicate that the JSON API does not support ETag If-Match/If-None-Match headers on modify requests (patch, delete, etc.), please correct me if I am mistaken.
This part two of #451. Part one in #488.
Fixes #451 🦕