-
-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Curl#curl_headers: Work with 8 exit_status #17412
Curl#curl_headers: Work with 8 exit_status #17412
Conversation
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.
Looks good! Agreed on @Bo98's comment and good to merge after that.
Might be an idea to make the 8
and 22
here constants in this file so the code is a bit more self-documenting.
9774cec
to
f511ea6
Compare
Updated to add constants for these curl exit status codes, using the names from |
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.
Looking good @samford! Just some suggested style/name changes.
I recently noticed that ~23 `livecheck` blocks using the `HeaderMatch` strategy were failing. Looking into it, these fail when using a `HEAD` request and retry with `GET` but the resulting response with the headers we want is simply discarded because the `exit_status` from curl is 8 ("weird server reply"). This resolves the issue by adding a special case for this exit status, so `#curl_headers` will return the headers in this scenario.
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
f511ea6
to
8236a70
Compare
Thanks again @samford! |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?I recently noticed that ~23
livecheck
blocks using theHeaderMatch
strategy were failing. Looking into it, these fail when using aHEAD
request and retry withGET
but the resulting response with the headers we want is simply discarded because theexit_status
from curl is 8 ("weird server reply").This resolves the issue by adding a special case for this exit status, so
#curl_headers
will return the headers in this scenario.