mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 14:07:30 +08:00
FEATURE: Normalize the service worker route (#12343)
Re-lands the change initially proposed on #8359 but without a new nginx location block, so it has less change surface. Co-authored-by: Jeff Wong <awole20@gmail.com> Co-authored-by: Jeff Wong <awole20@gmail.com>
This commit is contained in:

committed by
GitHub

parent
b0b23a969f
commit
9118bb2076
@ -65,7 +65,12 @@ end
|
||||
|
||||
task 'assets:flush_sw' => 'environment' do
|
||||
begin
|
||||
# Pending due to test failures.
|
||||
hostname = Discourse.current_hostname
|
||||
default_port = SiteSetting.force_https? ? 443 : 80
|
||||
port = SiteSetting.port.to_i > 0 ? SiteSetting.port : default_port
|
||||
STDERR.puts "Flushing service worker script"
|
||||
`curl -s -m 1 --resolve '#{hostname}:#{port}:127.0.0.1' #{Discourse.base_url}/service-worker.js > /dev/null`
|
||||
STDERR.puts "done"
|
||||
rescue
|
||||
STDERR.puts "Warning: unable to flush service worker script"
|
||||
end
|
||||
|
Reference in New Issue
Block a user