mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 22:51:06 +08:00
DEV: enable cors to all cdn get requests from workbox. (#10685)
Now all external requests from the service worker will be in CORS mode without credentials.
This commit is contained in:
@ -17,6 +17,7 @@ module Middleware
|
||||
allowed_hostnames = RailsMultisite::ConnectionManagement.current_db_hostnames
|
||||
requested_hostname = env[Rack::HTTP_HOST]
|
||||
|
||||
env[Discourse::REQUESTED_HOSTNAME] = requested_hostname
|
||||
env[Rack::HTTP_HOST] = allowed_hostnames.find { |h| h == requested_hostname } || Discourse.current_hostname
|
||||
|
||||
@app.call(env)
|
||||
|
Reference in New Issue
Block a user