changed authinfo comparison from nil to empty struct #39
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The addAuthTo function in utils/http/http.go performs a check of httpOptions.Auth to be nil, as to check whether it was specified or not, for authentication information is an optional property.
But, an Authentication information should always be passed as property to the capability.Execute() function, hence it is always a struct: either completely empty, or not.
As a consequence, the check in utils/http/http.go addAuthTo is not correct, and the logic further checks for consistency in the field of an empty struct to add authInfo to the headers. This obviously fails, whereas instead it should not be checked, as no auth headers should be added if an empty authInfo struct is passed.