Skip to content

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

Closed as not planned
@laurentsenta

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

kind/bugA bug in existing code (including security flaws)need/triageNeeds initial labeling and prioritization

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions