trailsjs / sails-swagger

Swagger integration for sails.js
107 stars 47 forks source link

Cors origin is hard-coded #13

Closed moisesrodriguez closed 8 years ago

moisesrodriguez commented 8 years ago

in the swagger config/routes the route is set to

'/swagger/doc': {
    cors: {
      origin: 'http://swagger.balderdash.io',
      methods: 'GET,OPTIONS,HEAD'
    },
    controller: 'SwaggerController',
    action: 'doc'
  }

even if change the route in my project's config/routes to

  '/swagger/doc': {
    cors: {
      origin: '*',
      methods: 'GET,OPTIONS,HEAD'
    },
    controller: 'SwaggerController',
    action: 'doc'
  }

it will not override the swagger config. for the time being I had to manually change the swagger node_module to actually let it other origins go through

tjwebb commented 8 years ago

Ah sorry about that. A PR would be appreciated

moisesrodriguez commented 8 years ago

@tjwebb looks like this might already fixed https://github.com/tjwebb/sails-swagger/commit/4849e486e1ab3cec32d2f87ed9c0ca3f61ebffe4. I'm using v0.5.1 from npm, but looks like some changes have been added, but have not been published to npm. If you can publish to npm, I can take a look if the problem still persists.

tjwebb commented 8 years ago

ok will do this weekend, thanks @moisesrodriguez

moisesrodriguez commented 8 years ago

@tjwebb hey just checking in see if you had any chance to bump the version and do a publish