-
Notifications
You must be signed in to change notification settings - Fork 100
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
fix(gateway): ensure 'X-Ipfs-Root' header is valid #337
Conversation
Codecov Report
@@ Coverage Diff @@
## main #337 +/- ##
==========================================
+ Coverage 51.01% 51.38% +0.37%
==========================================
Files 277 280 +3
Lines 33416 33443 +27
==========================================
+ Hits 17048 17186 +138
+ Misses 14629 14527 -102
+ Partials 1739 1730 -9
|
df19eb1
to
a93ce13
Compare
ea4603e
to
a845fce
Compare
a93ce13
to
c5f0cad
Compare
c5f0cad
to
7be4474
Compare
3c75a32
to
7be9206
Compare
63714df
to
a9794ec
Compare
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.
Thank you @hacdias, especially for adding a lot of missing tests. ❤️
Looks good, but we should add one test for HAMT (usual edge case) just to be sure + see some questions/style suggestions inline.
Co-authored-by: Marcin Rataj <lidel@lidel.org>
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.
lgtm (only a small hamt testing nit inline). Improved test coverage here is really valuable, thanks! 👍
Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Marcin Rataj <lidel@lidel.org> (cherry picked from commit 72238ea)
Fixes #221.
My idea is to create this struct
requestData
that is passed onto the handlers in order to keep the most possible information around. The other option would be to makehandleIfNoneMatch
return one more variable (the path metadata) and then pass it around. However, our functions already have a lot of parameters.I also cleaned up the existing tests and added a bunch of new tests for
Etag
,If-None-Match
andX-Ipfs-Roots
. Some of these tests should be also done in the gateway conformance. However, these have to be slightly different since we can't expect specificEtag
values. See ipfs/gateway-conformance#73 (comment).