-
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
Refactor HTTP digest authentication #800
Comments
While testing the fixes for #1044 and #1041, I looked through the current HTTP digest authentication code and noticed that it prematurely returns from Additionally, something that I've omitted to mention in the original issue message - currently the HTTP digest authentication will always make 2 separate http requests. |
Connected Golang issue: golang/go#29409 |
This simplifies the k6 implementation, and avoids returning prematurely on error, ensuring response timings are properly calculated. Closes grafana#800
Previously, there was an uncaught error (sometimes leading to panics) in the automatic response body decompression. This patch handles these decompression errors and even assigns a custom error code for them. As a bonus, k6 now also properly handles errors due to improper redirects, or too many redirects, and tags the resulting metric samples accordingly. By necessity, I had to also move the digest authentication handling to its own http.RoundTripper layer. This by no means solves the issues of #800, but it hopefully slightly improves the situation. A proper authentication cache and likely a different library still have to be used there eventually...
…#1102) Previously, there was an uncaught error (sometimes leading to panics) in the automatic response body decompression. This patch handles these decompression errors and even assigns a custom error code for them. As a bonus, k6 now also properly handles errors due to improper redirects, or too many redirects, and tags the resulting metric samples accordingly. By necessity, I had to also move the digest authentication and http-debug handling to their own http.RoundTripper layers. This by no means solves any of the following issues: - #800 - #986 - #1042 - #774 ...but it hopefully slightly improves the situation. For the digest authentication, a proper authentication cache, and very likely a different library, still have to be used... And regarding `http-debug`, a discussion about how some or all the remaining issues can be fixed can be found here: #1102 (comment)
There are some bugs with cookie handling in the NTLM authentication (#1210), which is currently handled in a very similar way to the digest authentication, so we should investigate if the same bug occurs here... |
Our current dependency seems to be dead, and has a bug that's can cause a panic... It assumes that a header value always contains And funky server responses can cause k6 to panic with:
|
Currently the HTTP digest authentication is part of the
http.request()
method, it would probably be better off (more readable and testable for sure) as ahttp.RoundTripper
wrapper like these. This issue is a spin-off from the original HTTP request refactoring one.The text was updated successfully, but these errors were encountered: