Skip to content
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

sharness - t0118 is broken - response for application/vnd.ipld.car SHOULD NOT include Content-Length #9651

Closed
3 tasks done
laurentsenta opened this issue Feb 16, 2023 · 4 comments
Assignees
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization

Comments

@laurentsenta
Copy link
Contributor

Checklist

Installation method

ipfs-update or dist.ipfs.tech

Version

Kubo version: 0.18.1
Repo version: 13
System version: arm64/darwin
Golang version: go1.19.1

Config

No response

Description

In sharness t0118 it seems that the test is misusing the invert option in grep:

# CAR is streamed, gateway may not have the entire thing, unable to calculate total size
test_expect_success "GET response for application/vnd.ipld.car includes no Content-Length" '
grep -qv "< Content-Length:" curl_output
'

The comment says that we should NOT return a Content-Length, but we do:

› cat curl_output | grep Content-Length                                                                                                                        ☹
< Access-Control-Expose-Headers: Content-Length
< Content-Length: 127

(tested with Kubo and a car gateway from go-libipfs)

Changing the test to : ! grep "< Content-Length:" curl_output reveals the error.

I found a few other cases where we use grep -v and that might have a similar issue:

> ack 'grep.*-v' ./ - | pbcopy
t0119-prometheus.sh
t0250-files-api.sh
t0140-swarm.sh
t0060-daemon.sh
t0080-repo.sh
t0230-channel-streaming-http-content-type.sh
t0141-addfilter.sh
t0046-id-hash.sh
@laurentsenta laurentsenta added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Feb 16, 2023
@lidel
Copy link
Member

lidel commented Feb 16, 2023

Thanks for catching this 👍
As we've discussed during 1:1

ps. I wonder if the same thing happens for TAR response?

@BigLep
Copy link
Contributor

BigLep commented Mar 19, 2023

This will get handled by ipfs/boxo#177 which is blocked.

@laurentsenta
Copy link
Contributor Author

Discussion also happening in ipfs/gateway-conformance#64

@lidel
Copy link
Member

lidel commented Jul 27, 2023

I believe this got resolved and can be closed:

@lidel lidel closed this as not planned Won't fix, can't repro, duplicate, stale Jul 27, 2023
@BigLep BigLep mentioned this issue Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants