Ticket #1271 (new enhancement) — at Version 2

Opened 3 years ago

Last modified 3 years ago

CORS support

Reported by: rgrp Owned by: rgrp
Priority: major Milestone: ckan-sprint-2011-10-28
Component: ckan Keywords:
Cc: Repository: ckan
Theme: none

Description (last modified by rgrp) (diff)

CORS - http://www.w3.org/TR/cors/ - support.

This is what you do in Apache. Should do this in lib/base.py or similar.

    Header always set Access-Control-Allow-Origin "*"
    Header always set Access-Control-Allow-Methods "POST, PUT, GET, OPTIONS"
    Header always set Access-Control-Allow-Headers "X-CKAN-API-KEY, Content-Type"

    # Respond to all OPTIONS requests with 200 OK
    # This could be done in the webapp
    # This is need for pre-flighted requests (POSTs/PUTs)
    RewriteEngine On
    RewriteCond %{REQUEST_METHOD} OPTIONS
    RewriteRule ^(.*)$ $1 [R=200,L]

Change History

comment:1 Changed 3 years ago by rgrp

  • Description modified (diff)
  • Milestone changed from ckan-v1.5 to ckan-current-sprint

comment:2 Changed 3 years ago by rgrp

  • Description modified (diff)
Note: See TracTickets for help on using tickets.