Skip to content

How to let the json file (*.json) return response header: 'application/json', instead of 'application/json; charset=UTF-8' #859

Open
@helloint

Description

@helloint

Environment Versions

  1. OS Type macOS
  2. Node version: $ node --version v12.22.12
  3. http-server version: $ http-server --version v14.1.1

Steps to reproduce

I have a json text file and start http-server

http-server ./public -c-1 -p 3000 --cors

What I got is: application/json; charset=UTF-8

How can I just let it return application/json?
I'm using latest http-server version, but I checked the source code, looks like this issue has been there from the very beginning.

Expected result

application/json

Actual result

application/json; charset=UTF-8

image

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions