bencebalogh / avro-schema-registry

Confluent Schema Registry implementation in javascript to easily serialize and deserialize kafka messages
MIT License
28 stars 30 forks source link

Error format without error_code and message #51

Closed fabianjunge closed 3 years ago

fabianjunge commented 3 years ago

Hello,

thanks for your awesome library. I like it.

In my usecase the authentication for our schema-registry is handelt by an nginx proxy before the schema-registry service. This nginx returns and 401 and a html payload. The library tries to parse this html and cashes in that case.

Sould I create an PR for that?

Example reponse:

Server: nginx
Date: Wed, 30 Jun 2021 09:34:02 GMT
Content-Type: text/html
Content-Length: 172
Connection: close
WWW-Authenticate: Basic realm="Schema Registry Read Login"

<html>
<head><title>401 Authorization Required</title></head>
<body>
<center><h1>401 Authorization Required</h1></center>
<hr><center>nginx</center>
</body>
</html>

Greetings Fabian

bencebalogh commented 3 years ago

Hi

Thanks for the kind words!

I think checking the status code would make sense, it'd help other cases as well.

After a quick check running a docker container locally the api responds with status 200 both for registering a new schema (POST) and returning a schema (GET)

A PR is welcome if you've got time, if not then I'll look for some time for it later this week and open one.

fabianjunge commented 3 years ago

Hi,

I created an PR.

Greetings Fabian

bencebalogh commented 3 years ago

Hi, sorry it took a while, thanks a lot for the PR, merged and released in 2.1.5