Set CORS headers for BTCPay API endpoints
This commit is contained in:
parent
4e566a0607
commit
3aa0c49507
@ -1,5 +1,6 @@
|
|||||||
class Api::BtcpayController < Api::BaseController
|
class Api::BtcpayController < Api::BaseController
|
||||||
before_action :require_feature_enabled
|
before_action :require_feature_enabled
|
||||||
|
before_action :set_cors_access_control_headers
|
||||||
|
|
||||||
def onchain_btc_balance
|
def onchain_btc_balance
|
||||||
balance = BtcpayManager::FetchOnchainWalletBalance.call
|
balance = BtcpayManager::FetchOnchainWalletBalance.call
|
||||||
@ -26,4 +27,10 @@ class Api::BtcpayController < Api::BaseController
|
|||||||
http_status :not_found and return
|
http_status :not_found and return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def set_cors_access_control_headers
|
||||||
|
headers['Access-Control-Allow-Origin'] = "*"
|
||||||
|
headers['Access-Control-Allow-Headers'] = "*"
|
||||||
|
headers['Access-Control-Allow-Methods'] = "GET"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user