Set Content-Type to `application/json; charset=UTF-8`

Open
#1,171 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
40/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
typescript
Domain
api

Research direction

Start in packages/browser/src/plugins/segmentio/batched-dispatcher.ts around line 88 and inspect how the batch request sets its Content-Type header. Compare the header with the JSON payload being sent; done means the batch request uses application/json; charset=UTF-8, with any relevant existing checks still passing.

Written by the indexing model from the issue text.

Description

Hey!
Currently the Content-Type header is set to text/plain, like here for the batch calls. Since we're sending JSON, should this be updated to application/json; charset=UTF-8, or is there any reason I'm not aware of to use text/plain?

Dominant language
TypeScript
Stars
477
Forks
160
Avg merge
6h 19m
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from segmentio/analytics-next

All issues in segmentio/analytics-next

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.