node-red-node-swagger icon indicating copy to clipboard operation
node-red-node-swagger copied to clipboard

/http-api/swagger.json is not CORS enabled

Open chameleonbr opened this issue 9 years ago • 2 comments

I have swagger UI on other server and I try to link with my node-red swagger API but CORS headers are not found on /http-api/swagger.json

curl -I http://myhost:1880/http-api/swagger.json
HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 921
ETag: W/"399-O+kHybLKLLCZ4lh4LITBaw"
Date: Wed, 20 Jan 2016 19:58:17 GMT
Connection: keep-alive

Placing the configuration:

httpNodeCors: {
        origin: "*",
        methods: "GET,PUT,POST,DELETE"
    },

it still happens

chameleonbr avatar Jan 20 '16 20:01 chameleonbr

Thanks for raising. The httpNodeCors configuration only gets applies to the HTTP In nodes - other things don't get it 'for free'. Will need to add in the proper handling for it in this node.

knolleary avatar Jan 20 '16 23:01 knolleary

It doesn't look like CORS support has been added yet. This would greatly be appreciated.

(Allowing external access to the swagger UI tab instead would be even better! Should I raise that asa feature request or is it unlikely to be implemented?)

tonykambo avatar Feb 22 '17 02:02 tonykambo