You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we don't check the response's Content-Type header before reading the body and passing it to the TokenParser. It would be nice to provide this information to the TokenParser, either as a string parameter or by passing the http.Request and allowing the TokenParser to do its own validation and parsing from there. Either option allows us to give up on parsing something if its not in the form we expect, and allows for more flexible parsing - a TokenParser could parse differently depending on the Content-Type provided.
Passing the full response would make it the TokenParser's responsibility to read and close the response body. Passing the Content-Type as a string allows TokenParsers to have no dependency on the http package.
The text was updated successfully, but these errors were encountered:
bascule/acquire/bearer.go
Lines 136 to 144 in c011b12
Currently, we don't check the response's
Content-Type
header before reading the body and passing it to theTokenParser
. It would be nice to provide this information to theTokenParser
, either as a string parameter or by passing thehttp.Request
and allowing theTokenParser
to do its own validation and parsing from there. Either option allows us to give up on parsing something if its not in the form we expect, and allows for more flexible parsing - aTokenParser
could parse differently depending on theContent-Type
provided.Passing the full response would make it the
TokenParser
's responsibility to read and close the response body. Passing theContent-Type
as a string allowsTokenParser
s to have no dependency on thehttp
package.The text was updated successfully, but these errors were encountered: