http-server icon indicating copy to clipboard operation
http-server copied to clipboard

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

Open helloint opened this issue 2 years ago • 1 comments

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.

helloint avatar May 20 '23 15:05 helloint

This issue has been inactive for 180 days

github-actions[bot] avatar Nov 17 '23 12:11 github-actions[bot]