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
When registering a new schema against the schema registry and I am not authorized I get a misleading error message: invalid character '<' looking for beginning of value
Instead of 401 unauthorized.
Because
`defer resp.Body.Close()
if resp.StatusCode == 200 {
if err = json.NewDecoder(resp.Body).Decode(response); err != nil {
return err
}
return nil
}
var failure RestError
if err := json.NewDecoder(resp.Body).Decode(&failure); err != nil {
return err
}
`
is parsing the response body as json right away.
In my case the unauthorized response body contains html.
How to reproduce
Set the schema registry up to require authentication
Register a new schema without credentials
Checklist
Please provide the following information:
confluent-kafka-go and librdkafka version (LibraryVersion()): v2.3.0
Description
When registering a new schema against the schema registry and I am not authorized I get a misleading error message:
invalid character '<' looking for beginning of value
Instead of 401 unauthorized.
Because
`defer resp.Body.Close()
if resp.StatusCode == 200 {
if err = json.NewDecoder(resp.Body).Decode(response); err != nil {
return err
}
return nil
}
`
is parsing the response body as json right away.
In my case the unauthorized response body contains html.
How to reproduce
Checklist
Please provide the following information:
LibraryVersion()
): v2.3.0ConfigMap{...}
:"debug": ".."
as necessary)The text was updated successfully, but these errors were encountered: