middleware: fix date header parse error log #1099
Merged
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.
This log message in
middleware.go
is not properly formatted because the format is being passed as the classification toLogf(classification Classification, format string, v ...interface{})
.Example output:
SDK 2021/02/01 22:20:44 failed to parse response Date Header value, got %!v(MISSING) parsing time "Mon, 1 Feb 2021 22:20:44 GMT" as "Mon Jan _2 15:04:05 2006": cannot parse ", 1 Feb 2021 22:20:44 GMT" as " "
Looking at the error and associated parsing code, it looks like an issue with some AWS endpoint not returning compliant timestamps that causes this warning (should technically be
01 Feb
not1 Feb
). I can provide a fix for that in a separate PR with slightly more permissive Date header parsing if needed.