comparison src/goodjava/webserver/handlers/ContentTypeHandler.java @ 1463:fb003c4003dd

better application/json handling
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 30 Mar 2020 18:31:18 -0600
parents 2c06a7ff4173
children 20375c20289d
comparison
equal deleted inserted replaced
1462:bfbf9c9c1586 1463:fb003c4003dd
29 contentTypeForNoExtension = htmlType; 29 contentTypeForNoExtension = htmlType;
30 map.put( "html", htmlType ); 30 map.put( "html", htmlType );
31 map.put( "txt", textType ); 31 map.put( "txt", textType );
32 map.put( "css", "text/css" ); 32 map.put( "css", "text/css" );
33 map.put( "js", "application/javascript" ); 33 map.put( "js", "application/javascript" );
34 map.put( "json", "application/json" + attrs );
34 map.put( "mp4", "video/mp4" ); 35 map.put( "mp4", "video/mp4" );
35 // add more as need 36 // add more as need
36 } 37 }
37 38
38 public Response handle(Request request) { 39 public Response handle(Request request) {