all: clean up Go 1.24 specific code. (#850)

This commit is contained in:
Maciej Kisiel 2026-03-20 12:28:56 +01:00 • committed by GitHub
commit ea161959d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -834,7 +834,7 @@ func (s *Server) lookupResourceHandler(uri string) (ResourceHandler, string, boo
// and the current working directory is unavailable, fileResourceHandler panics.
//
// Lexical path traversal attacks, where the path has ".." elements that escape dir,
// are always caught. Go 1.24 and above also protects against symlink-based attacks,
// are always caught. The SDK also protects against symlink-based attacks,
// where symlinks under dir lead out of the tree.
func fileResourceHandler(dir string) ResourceHandler {
// Convert dir to an absolute path.