We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use case:
We point to live-reload script and getting CORS error.
Desired behavour:
LiveReload server has option, to configure "allowed" host.
config.origin
https://foo.bar:80
diff --git a/node_modules/livereload/lib/livereload.js b/node_modules/livereload/lib/livereload.js index 512f7bf..c68ff2e 100644 --- a/node_modules/livereload/lib/livereload.js +++ b/node_modules/livereload/lib/livereload.js @@ -237,9 +237,13 @@ } requestHandler = function(req, res) { if (url.parse(req.url).pathname === '/livereload.js') { - res.writeHead(200, { - 'Content-Type': 'text/javascript' - }); + const headers = { + 'Content-Type': 'text/javascript', + 'Access-Control-Allow-Methods': 'GET, OPTIONS', + 'Access-Control-Allow-Origin': config.origin + }; + // corsDomains + res.writeHead(200, headers); return res.end(fs.readFileSync(require.resolve('livereload-js'))); } };
The text was updated successfully, but these errors were encountered:
See #155. Discussing this there.
Sorry, something went wrong.
No branches or pull requests
Use case:
We point to live-reload script and getting CORS error.
Desired behavour:
LiveReload server has option, to configure "allowed" host.
config.origin
is full host:https://foo.bar:80
The text was updated successfully, but these errors were encountered: