[ARVADOS] updated: 1.1.4-539-g5eda2f0ee
Git user
git at public.curoverse.com
Tue Jul 10 15:55:51 EDT 2018
Summary of changes:
lib/controller/federation_test.go | 17 +++++++++++++++++
services/api/app/controllers/static_controller.rb | 2 +-
2 files changed, 18 insertions(+), 1 deletion(-)
via 5eda2f0ee6fcab67d3a74517a85946435931c67b (commit)
from 8d3ecc67ad5d208e5327b81dffda0c10ef0a8378 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 5eda2f0ee6fcab67d3a74517a85946435931c67b
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date: Tue Jul 10 15:54:22 2018 -0400
13493: Test OPTIONS method.
API: Return empty body for OPTIONS requests.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>
diff --git a/lib/controller/federation_test.go b/lib/controller/federation_test.go
index 72f4259c9..268209280 100644
--- a/lib/controller/federation_test.go
+++ b/lib/controller/federation_test.go
@@ -170,6 +170,23 @@ func (s *FederationSuite) TestGetRemoteWorkflow(c *check.C) {
c.Check(wf.OwnerUUID, check.Equals, arvadostest.ActiveUserUUID)
}
+func (s *FederationSuite) TestOptionsMethod(c *check.C) {
+ req := httptest.NewRequest("OPTIONS", "/arvados/v1/workflows/"+arvadostest.WorkflowWithDefinitionYAMLUUID, nil)
+ req.Header.Set("Origin", "https://example.com")
+ resp := s.testRequest(req)
+ c.Check(resp.StatusCode, check.Equals, http.StatusOK)
+ body, err := ioutil.ReadAll(resp.Body)
+ c.Check(err, check.IsNil)
+ c.Check(string(body), check.Equals, "")
+ c.Check(resp.Header.Get("Access-Control-Allow-Origin"), check.Equals, "*")
+ for _, hdr := range []string{"Authorization", "Content-Type"} {
+ c.Check(resp.Header.Get("Access-Control-Allow-Headers"), check.Matches, ".*"+hdr+".*")
+ }
+ for _, method := range []string{"GET", "HEAD", "PUT", "POST", "DELETE"} {
+ c.Check(resp.Header.Get("Access-Control-Allow-Methods"), check.Matches, ".*"+method+".*")
+ }
+}
+
func (s *FederationSuite) TestRemoteWithTokenInQuery(c *check.C) {
req := httptest.NewRequest("GET", "/arvados/v1/workflows/"+strings.Replace(arvadostest.WorkflowWithDefinitionYAMLUUID, "zzzzz-", "zmock-", 1)+"?api_token="+arvadostest.ActiveToken, nil)
s.testRequest(req)
diff --git a/services/api/app/controllers/static_controller.rb b/services/api/app/controllers/static_controller.rb
index 594dc4362..f0992c183 100644
--- a/services/api/app/controllers/static_controller.rb
+++ b/services/api/app/controllers/static_controller.rb
@@ -25,7 +25,7 @@ class StaticController < ApplicationController
end
def empty
- render text: "-"
+ render text: ""
end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list