Skip to content

Commit 3080b41

Browse files
committed
net.http.file: allow for serving requests to static files with cache busting suffixes like /dist/littlejs.js?1117
1 parent 4665a6f commit 3080b41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vlib/net/http/file/static_server.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ fn (mut h StaticHttpHandler) handle(req http.Request) http.Response {
7474
defer {
7575
log.info('took: ${sw.elapsed().microseconds():6}µs, status: ${res.status_code}, size: ${res.body.len:9}, url: ${url}')
7676
}
77-
mut uri_path := url.all_after_first('/').trim_right('/')
77+
mut uri_path := url.all_after_first('/').all_before('?').trim_right('/')
7878
requested_file_path := os.norm_path(os.real_path(os.join_path_single(h.params.folder,
7979
uri_path)))
8080
if !requested_file_path.starts_with(h.params.folder) {

0 commit comments

Comments
 (0)