We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e58f84 commit 78046e5Copy full SHA for 78046e5
modules/public/public.go
@@ -45,15 +45,15 @@ func AssetsHandlerFunc(opts *Options) http.HandlerFunc {
45
return
46
}
47
48
- var corsSent bool
49
if opts.CorsHandler != nil {
+ var corsSent bool
50
opts.CorsHandler(http.HandlerFunc(func(http.ResponseWriter, *http.Request) {
51
corsSent = true
52
})).ServeHTTP(resp, req)
53
- }
54
- // If CORS is not sent, the response must have been written by other handlers
55
- if !corsSent {
56
- return
+ // If CORS is not sent, the response must have been written by other handlers
+ if !corsSent {
+ return
+ }
57
58
59
file := req.URL.Path[len(opts.Prefix):]
0 commit comments