Skip to content

Commit

Permalink
Merge pull request #560 from IU-Libraries-Joint-Development/add_cors_…
Browse files Browse the repository at this point in the history
…header

Adding CORS allow headers to the PURL resolver's response.
  • Loading branch information
wang58 authored Jul 25, 2023
2 parents e6ab0ae + ee988bc commit 18f8e8d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/controllers/purl_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class PurlController < ApplicationController
before_action :add_headers
def default
set_object(WORK_LOOKUPS, split_id: true)
respond_to do |f|
Expand Down Expand Up @@ -96,4 +97,8 @@ def render_404
def normalize_number(n)
[n.to_i - 1, 0].max
end

def add_headers
headers['Access-Control-Allow-Origin'] = '*'
end
end

0 comments on commit 18f8e8d

Please sign in to comment.