Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc638800

Browse files
committed
fix: make non-existent asset paths return a 404
Before, if a file was not found we would serve the app.
1 parentf24cb5c commitc638800

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎site/site.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,9 @@ func (h *Handler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
205205
casereqFile=="bin"||strings.HasPrefix(reqFile,"bin/"):
206206
h.handler.ServeHTTP(rw,r)
207207
return
208-
// If the original file path exists we serve it.
209-
caseh.exists(reqFile):
208+
// If the original file path exists or requesting assets we serve it.
209+
caseh.exists(reqFile),
210+
reqFile=="assets"||strings.HasPrefix(reqFile,"assets/"):
210211
ifShouldCacheFile(reqFile) {
211212
rw.Header().Add("Cache-Control","public, max-age=31536000, immutable")
212213
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp