Skip to content
Browse files

Allow cross origin requests access to Count and Link headers

  • Loading branch information...
1 parent d6d44f4 commit aee7864aac8c3acfe1526b5cc30e0af7fe9e31c6 Jesse Stuart committed Dec 21, 2012
Showing with 4 additions and 2 deletions.
  1. +2 −1 lib/tentd/api.rb
  2. +2 −1 lib/tentd/api/router/cors_headers.rb
View
3 lib/tentd/api.rb
@@ -42,7 +42,8 @@ def action(env)
headers = {
'Access-Control-Allow-Origin' => '*',
'Access-Control-Allow-Methods' => 'GET, POST, HEAD, PUT, DELETE, PATCH, OPTIONS',
- 'Access-Control-Allow-Headers' => 'Content-Type, Authorization, Count, Link',
+ 'Access-Control-Allow-Headers' => 'Content-Type, Authorization',
+ 'Access-Control-Expose-Headers' => 'Count, Link',
'Access-Control-Max-Age' => '2592000' # 30 days
}
[200, headers, []]
View
3 lib/tentd/api/router/cors_headers.rb
@@ -10,7 +10,8 @@ def call(env)
status, headers, body = @app.call(env)
headers.merge!(
'Access-Control-Allow-Origin' => '*',
- 'Access-Control-Allow-Headers' => 'Content-Type, Authorization, Count, Link',
+ 'Access-Control-Allow-Headers' => 'Content-Type, Authorization',
+ 'Access-Control-Expose-Headers' => 'Count, Link'
) if env['HTTP_ORIGIN']
[status, headers, body]
end

0 comments on commit aee7864

Please sign in to comment.
Something went wrong with that request. Please try again.