diff --git a/lib/middleware.js b/lib/middleware.js index 1b477aa9..b339a146 100644 --- a/lib/middleware.js +++ b/lib/middleware.js @@ -112,7 +112,7 @@ module.exports = function getMiddleware(watcher, options) { if(request.headers.origin) { // Check if origin resolves to a loopback IP, only add CORS headers if that's the case. dns.lookup(url.parse(request.headers.origin).hostname, function(err, address) { - if(!err && address === '127.0.0.1') { + if(!err && (address === '127.0.0.1' || address === '::1')) { response.setHeader('Access-Control-Allow-Origin', request.headers.origin) writeResponse() }