File tree 2 files changed +9
-0
lines changed
2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ if (argv.h || argv.help) {
26
26
' -s --silent Suppress log messages from output' ,
27
27
' --cors[=headers] Enable CORS via the "Access-Control-Allow-Origin" header' ,
28
28
' Optionally provide CORS headers list separated by commas' ,
29
+ ' --contentType Use a custom Content-Type response header for all requests' ,
29
30
' -o [path] Open browser window after starting the server' ,
30
31
' -c Cache time (max-age) in seconds [3600], e.g. -c10 for 10 seconds.' ,
31
32
' To disable caching, use -c-1.' ,
@@ -108,6 +109,10 @@ function listen(port) {
108
109
options . corsHeaders = argv . cors ;
109
110
}
110
111
}
112
+
113
+ if ( argv . contentType ) {
114
+ options . contentType = argv . contentType ;
115
+ }
111
116
112
117
if ( ssl ) {
113
118
options . https = {
Original file line number Diff line number Diff line change @@ -63,6 +63,10 @@ function HttpServer(options) {
63
63
64
64
res . emit ( 'next' ) ;
65
65
} ) ;
66
+
67
+ if ( options . contentType ) {
68
+ this . headers [ 'Content-Type' ] = options . contentType ;
69
+ }
66
70
67
71
if ( options . cors ) {
68
72
this . headers [ 'Access-Control-Allow-Origin' ] = '*' ;
You can’t perform that action at this time.
0 commit comments