Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dealing with charset=utf-8 in application/json responses #606

Open
bernhardreiter opened this issue Dec 18, 2024 · 3 comments
Open

Dealing with charset=utf-8 in application/json responses #606

bernhardreiter opened this issue Dec 18, 2024 · 3 comments

Comments

@bernhardreiter
Copy link
Member

Split out from #588:

How should we deal with a charset=utf-8 parameter to the content_type: application/json header in responses? This parameter is not allowed by the current JSON standard (rfc8259).

While rfc9431 recommends to be strict when receiving a non-standard thing for mid term benefits, we also should consider the ease of deployment.

After talks to @s-l-teichmann and @tschmidtb51, the plan is to

  • check out how popular webservers like freenginx, Apache and IIS would serve a .json file from disk by default.
  • find instructions to easily change this default to something else.

Depending on this we may consider to accept those responses for the downloader and aggregator and be strict on the checker, or be strict with both.

@adulau
Copy link

adulau commented Dec 18, 2024

I think we have to be realistic: there are many poorly implemented systems out there serving JSON with a charset defined in the Content-Type header. Silently dropping it is a more sensible approach than being overly strict about this.

@tschmidtb51
Copy link
Collaborator

@adulau I'm currently in favor of reporting it in the csaf_checker as error but warn in csaf_downloader (and accept the file). With this approach, we add point out that something is not right and still make it usable for the consumer that usually has no power of the provider's webserver settings...

@bernhardreiter
Copy link
Member Author

: there are many poorly implemented systems out there serving JSON with a charset defined in the Content-Type header.

Do you know which systems do so by default?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants