这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@bigkevmcd
Copy link
Contributor

To add additional headers to responses, we have to resort to something like...

allowed_cors_headers = Pliny::Middleware::CORS.send(:remove_const, :ALLOW_HEADERS).dup
allowed_cors_headers << "X-Origin"

Pliny::Middleware::CORS::ALLOW_HEADERS = allowed_cors_headers.freeze

It'd be nice if we could just configure the response headers globally when configuring our app?

end

def allow_headers
ALLOW_METHODS + @@additional_headers
Copy link

@raulb raulb Nov 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/ALLOW_METHODS/ALLOW_HEADERS

@gudmundur
Copy link
Member

Nicely done. I'm glad to see this contribution as the example you gave is something that's made my eyes all teary a few times. 😢

@gudmundur gudmundur merged commit 26eef13 into interagent:master Dec 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants