Skip to content

Commit 84ff2a2

Browse files
Colin Roacheindexzero
authored andcommitted
Add Access-Control-Allow-Headers to —cors to allow for AJAX requests
1 parent bf8d757 commit 84ff2a2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bin/http-server

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ function listen(port) {
6666
};
6767

6868
if (argv.cors) {
69-
options.headers = { 'Access-Control-Allow-Origin': '*' };
69+
options.headers = { 'Access-Control-Allow-Origin': '*',
70+
'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept' };
7071
}
7172

7273
if (argv.S) {

0 commit comments

Comments
 (0)