Skip to content

Commit

Permalink
Fix regression in service worker generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
gdotdesign committed Jun 17, 2021
1 parent b8533cd commit 926834c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/utils/service_worker.cr
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ module Mint
ECR.def_to_s "#{__DIR__}/service_worker.ecr"

def files
Dir
.glob("**/*")
.reject! { |file| File.directory?(file) }
.join(",\n") { |file| "'/#{file}'" }
Dir.cd("dist") do
Dir
.glob("**/*")
.reject! { |file| File.directory?(file) }
.join(",\n") { |file| "'/#{file}'" }
end
end

def calculate_hash
Expand Down
2 changes: 1 addition & 1 deletion src/utils/service_worker.ecr
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ self.addEventListener('fetch', event => {
response = fetch(event.request)
}

event.respondWith(response)
response.then((actualResponse) => event.respondWith(actualResponse))
})

0 comments on commit 926834c

Please sign in to comment.