Re: Autoresponder not inserting content-type for json files

881 views
Skip to first unread message

EricLaw

unread,
Jun 12, 2013, 3:00:53 PM6/12/13
to
Fiddler's AutoResponder works as follows:
 
1> The target file is checked for any HTTP Headers preceding the content. If these are found (e.g. HTTP/1.1 200 OK\r\nBlah blah blah) then Fiddler will return these headers and then the rest of the file.
2> If the target file does not contain any HTTP headers, then Fiddler autogenerates a set of headers like so:
 

HTTP/1.1 200 OK with automatic headers
Date: Wed, 12 Jun 2013 18:46:24 GMT
Content-Length: 19
Cache-Control: max-age=0, must-revalidate

Fiddler will include a Content-Type header if and only if the file's extension is registered in the registry and contains the appropriate Content Type subkey. By default, JSON files tend not to be registered.

While you could fix your issue by including the full set of headers in your JSON file, the simplest fix is to save the following text file as RegisterJSON.reg and then run it:

Windows Registry Editor Version 5.00
 
[HKEY_CLASSES_ROOT\.json]
"Content Type"="application/json"
 
After you do so, Fiddler will begin using the Content-Type.
Reply all
Reply to author
Forward
0 new messages