-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
httpext: replace HTTP digest library #4599
base: master
Are you sure you want to change the base?
Conversation
572b366
to
77bfb81
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.
} | ||
|
||
// Actually make the HTTP request with the proper Authorization | ||
return t.originalTransport.RoundTrip(req) | ||
return digestTr.RoundTrip(req) |
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.
github.com/icholy/digest
will handle the 401 response and cache the digest challenge for us.
https://github.com/icholy/digest/blob/v1.1.0/transport.go#L141-L188
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 for the PR @Juneezee 🙇
I think that we can drop the whole digest_transport.go
file and not have one more transport wrapper.
I wonder if we can get some tests to see that we do not get 401 each time , as that is one of the consequences of the original issue that we want fixed.
Reference: grafana#4599 (review) Signed-off-by: Eng Zer Jun <[email protected]>
@mstoykov I tried it, and it seems that the k6/js/modules/k6/http/request_test.go Lines 956 to 957 in dafd7f8
|
Will it be possible to support custom digest header set by js |
Reference: grafana#4599 (review) Signed-off-by: Eng Zer Jun <[email protected]>
8d3e74a
to
d58e09e
Compare
The current HTTP digest library, `github.com/Soontao/goHttpDigestClient`, has not been updated since March 2017 and is known to be buggy. This commit replaces it with `github.com/icholy/digest`, a more modern library that provides an `http.RoundTripper` implementation, allowing digest challenges to be reused. This aligns well with our use case. Closes grafana#800. Signed-off-by: Eng Zer Jun <[email protected]>
Reference: grafana#4599 (review) Signed-off-by: Eng Zer Jun <[email protected]>
d58e09e
to
b870206
Compare
What?
This PR replaces our current HTTP digest library
github.com/Soontao/goHttpDigestClient
withgithub.com/icholy/digest
.Why?
The current HTTP Digest library,
github.com/Soontao/goHttpDigestClient
, has not been updated since March 2017 and is known to be buggy.github.com/icholy/digest
is a newer library that provides anhttp.RoundTripper
implementation, allowing digest challenges to be reused. This aligns well with our use case.Checklist
make check
) and all pass.Checklist: Documentation (only for k6 maintainers and if relevant)
Please do not merge this PR until the following items are filled out.
Related PR(s)/Issue(s)
Closes #800.