-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
html: use strings.EqualFold instead of lowering ourselves
Instead of using strings.ToLower and == to check case insensitive equality, just use strings.EqualFold, even when the strings are only ASCII. This prevents us unnecessarily lowering extremely long strings, which can be a somewhat expensive operation, even if we're only attempting to compare equality with five characters. Thanks to Guido Vranken for reporting this issue. Fixes golang/go#70906 Fixes CVE-2024-45338 Change-Id: I323b919f912d60dab6a87cadfdcac3e6b54cd128 Reviewed-on: https://go-review.googlesource.com/c/net/+/637536 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Gopher Robot <gobot@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
- Loading branch information
1 parent
b935f7b
commit 8e66b04
Showing
3 changed files
with
4 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters