-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
caddyhttp: Address some Go 1.20 features #6252
Conversation
modules/caddyhttp/caddyhttp_test.go
Outdated
@@ -63,7 +63,7 @@ func TestSanitizedPathJoin(t *testing.T) { | |||
{ | |||
inputRoot: "/a/b", | |||
inputPath: "/%2e%2e%2f%2e%2e%2f", | |||
expect: filepath.Join("/", "a", "b") + separator, | |||
expect: filepath.Join("/", "a", "b"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The inputPath
is deemed by IsLocal()
to be unsafe (that is, not local); which surprised me. In that case we just return the root without any request path appended... hence removing the + separator
here, but I don't fully 100% understand the reason for this.
Gah. Linter is running into this issue: daixiang0/gci#76 both As a workaround, I'm trying to move this import to a file of its own, with the comment above the |
Ah, I wondered... Because I manually put it at the very next line but goimports kept adding a new line when I saved. I figured that must be the wrong place, but I guess not. It looks like the issue upstream in gci is closed? So maybe there's a resolution. |
Nope, it was closed prematurely |
$ gci -s standard -s default -s 'prefix(github.com/caddyserver/caddy/v2/cmd)' -s 'prefix(github.com/caddyserver/caddy)' --custom-order -w ../../cmd/main.go
ab85db3
to
50cf536
Compare
See #5288.