This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23196 - Content-Type HTTP headers lacks charset information when json format is requested
Summary: Content-Type HTTP headers lacks charset information when json format is reque...
Status: RESOLVED FIXED
Alias: None
Product: HTML Checker
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Michael[tm] Smith
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-10 12:33 UTC by Thomas Gambet
Modified: 2013-09-10 23:20 UTC (History)
1 user (show)

See Also:


Attachments

Description Thomas Gambet 2013-09-10 12:33:31 UTC
When requesting a result as json the server does not specify a complete Content-Type header:
[ Content-Type: application/json ]

Since the content is UTF-8 the header should be:
[ Content-Type: application/json; charset=utf-8 ]

----------------

$ lwp-request -e -d  "http://validator.w3.org/nu/?doc=http%3A%2F%2Fwww.w3.org&out=json"
Cache-Control: no-cache
Connection: close
Date: Tue, 10 Sep 2013 12:26:18 GMT
Accept-Encoding: gzip
Server: Jetty(6.1.26)
Content-Type: application/json
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Access-Control-Allow-Origin: *
Client-Date: Tue, 10 Sep 2013 12:26:17 GMT
Client-Peer: 128.30.52.91:80
Client-Response-Num: 1
Client-Transfer-Encoding: chunked
Comment 1 Michael[tm] Smith 2013-09-10 23:20:40 UTC
Thanks -- fixed in the sources now

https://github.com/validator/validator/commit/c2c0526cb02c605f2a543e1078ae334c717d5ea7