Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: Last-Modified header did not correctly check the time #66807

Closed
bddjr opened this issue Apr 13, 2024 · 2 comments
Closed

net/http: Last-Modified header did not correctly check the time #66807

bddjr opened this issue Apr 13, 2024 · 2 comments

Comments

@bddjr
Copy link

bddjr commented Apr 13, 2024

Go version

go version go1.22.2 windows/amd64

Output of go env in your module/workspace:

set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\bddjr\AppData\Local\go-build
set GOENV=C:\Users\bddjr\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\bddjr\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\bddjr\go
set GOPRIVATE=
set GOPROXY=https://goproxy.cn
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.22.2
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
set GOMOD=D:\bddjr\Desktop\code\golang\BCSPanel\go.mod
set GOWORK=D:\bddjr\Desktop\code\golang\BCSPanel\go.work
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\bddjr\AppData\Local\Temp\go-build2942921968=/tmp/go-build -gno-record-gcc-switches

What did you do?

When I mount a new file and then re mount it as an old file, the server still returns 304, causing the client to not update.

What did you see happen?

304 Not Modified

image

What did you expect to see?

200 OK

Just change this place to == :
https://github.com/golang/go/blob/master/src/net/http/fs.go#L480C36-L480C38

@gopherbot
Copy link

Change https://go.dev/cl/578615 mentions this issue: net/http: Last-Modified header did not correctly check the time

@seankhliao
Copy link
Member

This doesn't look right, If-Modified-Since is for checking a range of time https://datatracker.ietf.org/doc/html/rfc7232#section-3.3 , not just a single time instance.

@bddjr bddjr closed this as completed Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants