]> Cypherpunks repositories - gostls13.git/commit
net/http: refine trailing-slash redirect logic
authorJonathan Amsterdam <jba@google.com>
Fri, 9 Feb 2024 15:18:38 +0000 (10:18 -0500)
committerJonathan Amsterdam <jba@google.com>
Tue, 13 Feb 2024 13:54:22 +0000 (13:54 +0000)
commite17e5308fd5a26da5702d16cc837ee77cdb30ab6
tree3aab3941c2ff970eaf5865c2725ddf79d99a1e8a
parent2a5904142043e8998eaa15728150c48bcfdca7d5
net/http: refine trailing-slash redirect logic

Do not add a trailing slash and redirect if the path already
ends in a slash.

Also, and unrelatedly, add a test for cleanPath.

Fixes #65624.

Change-Id: Ifcf9edc929d2eb6db88132c09d2bade85c5dda3d
Reviewed-on: https://go-review.googlesource.com/c/go/+/562557
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/net/http/serve_test.go
src/net/http/server.go
src/net/http/server_test.go