From 68c6b9239d9bd7aaa7a2c452540b31b8c188fa99 Mon Sep 17 00:00:00 2001 From: Konstantin Haase Date: Wed, 18 Feb 2015 14:59:57 +0100 Subject: [PATCH] allow setting Travis-API-Version header via ajax --- lib/travis/api/app/cors.rb | 2 +- spec/unit/cors_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/travis/api/app/cors.rb b/lib/travis/api/app/cors.rb index 9112300b..cfbe133c 100644 --- a/lib/travis/api/app/cors.rb +++ b/lib/travis/api/app/cors.rb @@ -14,7 +14,7 @@ class Travis::Api::App options // do headers['Access-Control-Allow-Methods'] = "HEAD, GET, POST, PATCH, PUT, DELETE" - headers['Access-Control-Allow-Headers'] = "Content-Type, Authorization, Accept, If-None-Match, If-Modified-Since, X-User-Agent" + headers['Access-Control-Allow-Headers'] = "Content-Type, Authorization, Accept, If-None-Match, If-Modified-Since, X-User-Agent, Travis-API-Version" end end end diff --git a/spec/unit/cors_spec.rb b/spec/unit/cors_spec.rb index cd90dd6d..f5c6b0fd 100644 --- a/spec/unit/cors_spec.rb +++ b/spec/unit/cors_spec.rb @@ -44,7 +44,7 @@ describe Travis::Api::App::Cors do end it 'sets Access-Control-Allow-Headers' do - headers['Access-Control-Allow-Headers'].should == "Content-Type, Authorization, Accept, If-None-Match, If-Modified-Since, X-User-Agent" + headers['Access-Control-Allow-Headers'].should == "Content-Type, Authorization, Accept, If-None-Match, If-Modified-Since, X-User-Agent, Travis-API-Version" end end end