arthurnn / arthurnn/twirp-ruby

Allow specifying charset in the content-type header

Open
#89 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
163
Forks
61
PR merge metrics
No merged PRs in 30d

Description

Some HTTP clients always append charset to the content-type header e.g., `content-type: application/json; charset=utf8`. Requests made by those clients are rejected because of the content-type mismatch.

Twirp only allows the content-type header exactly matches one of `aplication/json`, `application/json; strict=true` or `application/probobuf`. This seems too strict, can we relax this constraint?

Thank you.

Contributor guide

Open the contributing guide

Research direction

The issue names no files or tests. Start by locating Twirp's content-type validation and its existing request tests, then compare the accepted media types with clients that append charset. Done means the reported charset-bearing content type is accepted without weakening unrelated content-type checks, with coverage for that header form.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.