[ckan-changes] [okfn/ckan] 78deae: [master, lib/base, cors][xs]: add Authorization to a...

GitHub noreply at github.com
Mon Apr 23 00:41:35 UTC 2012


  Branch: refs/heads/master
  Home:   https://github.com/okfn/ckan
  Commit: 78deae0bf61a89254e80f9575d5678cd03827504
      https://github.com/okfn/ckan/commit/78deae0bf61a89254e80f9575d5678cd03827504
  Author: Rufus Pollock <rufus.pollock at okfn.org>
  Date:   2012-04-22 (Sun, 22 Apr 2012)

  Changed paths:
    M ckan/lib/base.py

  Log Message:
  -----------
  [master,lib/base,cors][xs]: add Authorization to allowed CORS headers and OPTIONS to allowed methods.


diff --git a/ckan/lib/base.py b/ckan/lib/base.py
index 075029c..dd1f03b 100644
--- a/ckan/lib/base.py
+++ b/ckan/lib/base.py
@@ -245,8 +245,8 @@ def __after__(self, action, **params):
 
     def _set_cors(self):
         response.headers['Access-Control-Allow-Origin'] = "*"
-        response.headers['Access-Control-Allow-Methods'] = "POST, PUT, GET, DELETE"
-        response.headers['Access-Control-Allow-Headers'] = "X-CKAN-API-KEY, Content-Type"
+        response.headers['Access-Control-Allow-Methods'] = "POST, PUT, GET, DELETE, OPTIONS"
+        response.headers['Access-Control-Allow-Headers'] = "X-CKAN-API-KEY, Authorization, Content-Type"
 
     def _get_user(self, reference):
         return model.User.by_name(reference)


================================================================



More information about the ckan-changes mailing list