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

Add check for HEAD response to be empty #2775

Merged
merged 1 commit into from
Jun 1, 2016
Merged

Conversation

Kubuxu
Copy link
Member

@Kubuxu Kubuxu commented May 31, 2016

Resolves #2194

License: MIT
Signed-off-by: Jakub Sztandera kubuxu@protonmail.ch

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
@@ -116,6 +116,11 @@ test_expect_success "output looks good" '
grep "Content-Type: text/html" indexout
'

test_expect_success "HEAD 'index.html' has no content" '
curl -X HEAD --max-time 1 http://127.0.0.1:$port/ipfs/$INDEXHASH/ > output;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should have an && between these. otherwise this will pass if the curl command fails

Copy link
Member Author

@Kubuxu Kubuxu May 31, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The curl will fail as for the timeout because curl won't terminate if you use -X HEAD it will wait for the rest of response that should not be coming.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use --head then?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this test is to check if head request has no content. --head won't return the content even if it is there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, makes sense. Carry on!

@Kubuxu Kubuxu added the need/review Needs a review label May 31, 2016
@whyrusleeping whyrusleeping merged commit ed2d94b into master Jun 1, 2016
@whyrusleeping whyrusleeping deleted the feature/head-no-body branch June 1, 2016 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/review Needs a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants