We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
A code like this would produce a warning saying Using sensitive credentials in HTTP mode is not secure. Use HTTPS:
Using sensitive credentials in HTTP mode is not secure. Use HTTPS
resty.New(). SetBaseURL("https://example.com"). SetAuthToken("example")
This behaviour is incorrect, because the base URL clearly starts with the secure https protocol scheme.
https
The behaviour was introduced in the commit 3b97332 with this piece of code:
resty/middleware.go
Lines 318 to 322 in 3b97332
Any URL string starting with https:// would indeed technically have an http prefix, so the warning is logged regardless.
https://
http
This could be fixed by either changing the statement to something inversed like:
if !strings.HasPrefix(r.URL, "https")
Or, if done properly, by checking the parsed protocol scheme. Something along the lines of:
if r.RawRequest.URL.Scheme == "http"
Thank you!
The text was updated successfully, but these errors were encountered:
Just realised the warning is actually produced when a request is made, not when Resty is instantiated.
This doesn't change the issue though.
Sorry, something went wrong.
No branches or pull requests
A code like this would produce a warning saying
Using sensitive credentials in HTTP mode is not secure. Use HTTPS
:This behaviour is incorrect, because the base URL clearly starts with the secure
https
protocol scheme.The behaviour was introduced in the commit 3b97332 with this piece of code:
resty/middleware.go
Lines 318 to 322 in 3b97332
Any URL string starting with
https://
would indeed technically have anhttp
prefix, so the warning is logged regardless.This could be fixed by either changing the statement to something inversed like:
Or, if done properly, by checking the parsed protocol scheme. Something along the lines of:
Thank you!
The text was updated successfully, but these errors were encountered: