airframe icon indicating copy to clipboard operation
airframe copied to clipboard

airframe-http (js): Cross origin http://localhost forbidden error during testing

Open xerial opened this issue 2 years ago • 1 comments

Error: Cross origin http://localhost forbidden
    at dispatchError (/Users/leo/work/git/airframe/node_modules/jsdom/lib/jsdom/living/xhr/xhr-utils.js:63:19)
    at Object.validCORSHeaders (/Users/leo/work/git/airframe/node_modules/jsdom/lib/jsdom/living/xhr/xhr-utils.js:75:5)
    at receiveResponse (/Users/leo/work/git/airframe/node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:794:19)
    at Request.<anonymous> (/Users/leo/work/git/airframe/node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:658:43)
    at Request.emit (node:events:513:28)
    at Request._processResponse (/Users/leo/work/git/airframe/node_modules/jsdom/lib/jsdom/living/helpers/http-request.js:228:12)
    at ClientRequest.<anonymous> (/Users/leo/work/git/airframe/node_modules/jsdom/lib/jsdom/living/helpers/http-request.js:101:12)
    at Object.onceWrapper (node:events:628:26)
    at ClientRequest.emit (node:events:513:28)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:701:27) {
  type: 'XMLHttpRequest'
}

xerial avatar Apr 28 '23 17:04 xerial

It looks like the http connection is forgetting about making requests from the Node jsdom environment while running sbt tests.

Using https://github.com/wvlet/airframe/issues/2897 may solve the issue. Slow response from httpbin is also related, so I removed tests using httpbin #2906

xerial avatar Apr 28 '23 18:04 xerial