-
Notifications
You must be signed in to change notification settings - Fork 149
feat(gw): support UnixFS 1.5 on gateway responses as Last-Modified #659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## main #659 +/- ##
==========================================
+ Coverage 60.13% 60.16% +0.02%
==========================================
Files 241 241
Lines 30617 30681 +64
==========================================
+ Hits 18412 18459 +47
- Misses 10560 10570 +10
- Partials 1645 1652 +7
|
47dca25 to
f4259d6
Compare
f894d64 to
0617d60
Compare
(if present)
0617d60 to
1fcc68b
Compare
bare minimum support for Last-Modified and If-Modified-Since
lidel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed next steps here with @gammazero during triage today and we decided to ship basic gateway support for Last-Modified / If-Modified-Since for UnixFS 1.5 files with backend_blocks.go (used by Rainbow and Kubo).
The remaining work can be done at a later time, if there is real world need for support in CAR backend. I've filled #664 for that.
Merging this so we can include it in Kubo 0.30.0-rc2.
| return false | ||
| } | ||
|
|
||
| func (i *handler) handleIfModifiedSince(w http.ResponseWriter, r *http.Request, rq *requestData) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ this is based on what we already had in handleIfNoneMatch to support If-None-Match, which operates on Etags.
This one is executed only if If-Modified-Since is present in request, which usually is less popular than more deterministic If-None-Match.
Still, we add is here as it costs us nothing to avoid returning payload and returning HTTP 304 Not Modified instead.
| func TestHeadersUnixFSModeModTime(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| ts, _, root := newTestServerAndNode(t, "unixfs-dir-with-mode-mtime.car") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ created with Kubo 0.30.0-rc1
|
Added more tests, CI in ipfs/kubo#10494 is green, merging. |
…ed (ipfs#659) bare minimum support for Last-Modified and If-Modified-Since if mtime present in dag-pb
This is bit more involved, and I don't want to block #653 on it, so filling this separate PR.
This PR builds on top of #653 and exposes
mtimefromdag-pbasLast-Modifiedheader on deserialized/ipfsand/ipnsresponses (ones that are used for web hosting, and not trustless responses).TODO
Last-Modifiedon GET responsesLast-Modifiedon HEAD responsesIf-Modified-Since(UnixFS 1.5 file only)Last-ModifiedandIf-Modified-Sincetests with and without UnixFS 1.5(Below moved to #664)
Last-Modifiedon GET responsesLast-Modifiedon HEAD responsesGetandHeadandContentPathMetadataneeds to be updated there as well)