summaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/net/http2/ascii.go
diff options
context:
space:
mode:
authorLibravatar Terin Stock <terinjokes@gmail.com>2025-03-09 17:47:56 +0100
committerLibravatar Terin Stock <terinjokes@gmail.com>2025-03-10 01:59:49 +0100
commit3ac1ee16f377d31a0fb80c8dae28b6239ac4229e (patch)
treef61faa581feaaeaba2542b9f2b8234a590684413 /vendor/golang.org/x/net/http2/ascii.go
parent[chore] update URLs to forked source (diff)
downloadgotosocial-3ac1ee16f377d31a0fb80c8dae28b6239ac4229e.tar.xz
[chore] remove vendor
Diffstat (limited to 'vendor/golang.org/x/net/http2/ascii.go')
-rw-r--r--vendor/golang.org/x/net/http2/ascii.go53
1 files changed, 0 insertions, 53 deletions
diff --git a/vendor/golang.org/x/net/http2/ascii.go b/vendor/golang.org/x/net/http2/ascii.go
deleted file mode 100644
index 17caa2058..000000000
--- a/vendor/golang.org/x/net/http2/ascii.go
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2021 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package http2
-
-import "strings"
-
-// The HTTP protocols are defined in terms of ASCII, not Unicode. This file
-// contains helper functions which may use Unicode-aware functions which would
-// otherwise be unsafe and could introduce vulnerabilities if used improperly.
-
-// asciiEqualFold is strings.EqualFold, ASCII only. It reports whether s and t
-// are equal, ASCII-case-insensitively.
-func asciiEqualFold(s, t string) bool {
- if len(s) != len(t) {
- return false
- }
- for i := 0; i < len(s); i++ {
- if lower(s[i]) != lower(t[i]) {
- return false
- }
- }
- return true
-}
-
-// lower returns the ASCII lowercase version of b.
-func lower(b byte) byte {
- if 'A' <= b && b <= 'Z' {
- return b + ('a' - 'A')
- }
- return b
-}
-
-// isASCIIPrint returns whether s is ASCII and printable according to
-// https://tools.ietf.org/html/rfc20#section-4.2.
-func isASCIIPrint(s string) bool {
- for i := 0; i < len(s); i++ {
- if s[i] < ' ' || s[i] > '~' {
- return false
- }
- }
- return true
-}
-
-// asciiToLower returns the lowercase version of s if s is ASCII and printable,
-// and whether or not it was.
-func asciiToLower(s string) (lower string, ok bool) {
- if !isASCIIPrint(s) {
- return "", false
- }
- return strings.ToLower(s), true
-}