feat(services/http): support if_modified_since and if_unmodified_since#7636
Conversation
570288e to
324ccaa
Compare
|
@Xuanwo This is ready for review. The failing checks are unrelated flaky tests. Could you help re-run them? Thanks! |
Inject If-Modified-Since and If-Unmodified-Since in http_get_request and http_head_request, and declare the matching read/stat capabilities. Part of apache#5486.
2aeec52 to
8c083c3
Compare
|
|
||
|
|
||
| @pytest.mark.need_capability( | ||
| "read", "read_with_if_modified_since", "read_with_if_unmodified_since" |
There was a problem hiding this comment.
Hmm, what does this change for python binding?
There was a problem hiding this comment.
without this change, enabling read_with_if_modified_since / read_with_if_unmodified_since on the HTTP service makes test_sync_conditional_reads newly match the HTTP backend via need_capability, then crash on operator.write() since HTTP is read-only. Adding write / delete to the gate aligns it with what the test body actually does and keeps the test skipped on read-only backends
There was a problem hiding this comment.
Thanks. We can skip delete here. And we probably don't need to clean up explicitly.
erickguan
left a comment
There was a problem hiding this comment.
Thank you so much for working on this!
Which issue does this PR close?
Part of #5486.
Rationale for this change
The http service already wires
if_match/if_none_matchon read and stat. RFC 7232 definesIf-Modified-Since/If-Unmodified-Sinceas the date-based counterparts, and they're standard on every HTTP/1.1 serverWhat changes are included in this PR?
If-Modified-Since/If-Unmodified-Sinceinhttp_get_requestandhttp_head_request.read_with_if_modified_since,read_with_if_unmodified_since,stat_with_if_modified_since,stat_with_if_unmodified_sinceon the http service capability.Are there any user-facing changes?
Yes —
op.reader_with(path).if_modified_since(...)/if_unmodified_since(...)(and the stat equivalents) now work against http backends. No breaking changes.AI Usage Statement
AI-assisted implementation.