Comments (6)
Try passing an Origin: header
Sent from my iPhone
On Feb 7, 2014, at 5:57 PM, Rifat Nabi [email protected] wrote:
curl -I -X OPTIONS "http://localhost:9090/api-docs"
HTTP/1.1 200 OK
X-Powered-By: Express
Allow: GET
Content-Type: text/html; charset=utf-8
Content-Length: 3
Date: Fri, 07 Feb 2014 22:55:01 GMT
Connection: keep-alive
curl -I "http://localhost:9090/api-docs"HTTP/1.1 200 OK
X-Powered-By: Express
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE
Access-Control-Allow-Headers: Content-Type, api_key
Content-Type: application/json; charset=utf-8
Date: Fri, 07 Feb 2014 22:56:01 GMT
Connection: keep-alive
curl -I -X OPTIONS "http://petstore.swagger.wordnik.com/api/api-docs"HTTP/1.1 204 No Content
Date: Fri, 07 Feb 2014 23:06:17 GMT
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, DELETE, PUT, PATCH, OPTIONS
Access-Control-Allow-Headers: Content-Type, api_key, Authorization
Allow: OPTIONS,GET,HEAD
Connection: close
I tried adding the setHeaders but no luck.—
Reply to this email directly or view it on GitHub.
from swagger-node.
@muanis Just tried curl -I -X OPTIONS "http://localhost:9090/api-docs/" -H "Origin: http://localhost/"
. Same result.
from swagger-node.
Here's what I'm trying - https://github.com/torifat/angular-education/blob/master/api/server.js#L59
from swagger-node.
Try pointing your package.json to github master and follow the instructions at the end of the readme, I just pr something but I doubt it's on the npm repo already.
And don't replace the origin header. Let the cors module take care of it.
from swagger-node.
@muanis Yes, I noticed your PR. Thanks for the quick replies.
from swagger-node.
closing as this is outside the swagger module.
from swagger-node.
Related Issues (20)
- Is there a way to hide an API in swagger UI ? Something like `hidden: true` in API definitions in swagger json file for nodejs application
- INVALID_TYPE on Date format field
- e.replace is not a function
- bug & Error: Response validation failed: failed schema validation HOT 2
- lodash version causing node vulnerability audit HOT 1
- swagger project edit cannot get / HOT 13
- I facing Issue in Swagger api ? HOT 1
- Error: Cannot find module swagger_router HOT 23
- Question: is `swagger-node-express` out of date? HOT 2
- Question: swagger-node-express has dependency vulnerability with outdated lodash version HOT 1
- Getting stack trace in swagger validation response
- Invalid request body validation for properties defined with capital letters
- Is this project deprecated? HOT 4
- Current version using old version of mocha that has a critical vulnerability HOT 1
- Uploading files mongodb using gridfs using swagger-tools, swagger-ui-express, multer-gridfs-storage, multer
- is the swagger-ui automatically included ?
- Is swagger-node deprecated? HOT 1
- help me to solve this issue
- 361 HOT 1
- Is there any possibility to upload auto generated swagger docs to the swagger.io
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swagger-node.