🔖 chore: Remove invalid code

This commit is contained in:
MartialBE
2024-05-29 04:38:56 +08:00
parent b5a4283b28
commit 021f8c65da
43 changed files with 46 additions and 341 deletions

View File

@@ -58,10 +58,6 @@ var requiredHeaders = map[string]struct{}{
"X-Amz-Tagging": {},
}
// headerPredicate is a function that evaluates whether a header is of the
// specific type. For example, whether a header should be ignored during signing.
type headerPredicate func(header string) bool
// isIgnoredHeader returns true if header must be ignored during signing.
func isIgnoredHeader(header string) bool {
_, ok := ignoreHeaders[header]

View File

@@ -9,7 +9,6 @@ import (
"net/url"
"sort"
"strings"
"time"
)
var (
@@ -47,17 +46,6 @@ func hasPrefixFold(s, prefix string) bool {
strings.EqualFold(s[0:len(prefix)], prefix)
}
// isSameDay returns true if a and b are the same date (dd-mm-yyyy).
func isSameDay(a, b time.Time) bool {
xYear, xMonth, xDay := a.Date()
yYear, yMonth, yDay := b.Date()
if xYear != yYear || xMonth != yMonth {
return false
}
return xDay == yDay
}
// hostOrURLHost returns r.Host, or if empty, r.URL.Host.
func hostOrURLHost(r *http.Request) string {
if r.Host != "" {
@@ -271,32 +259,3 @@ func writeCanonicalString(w *bufio.Writer, s string) {
w.WriteByte(s[i])
}
}
type debugHasher struct {
buf []byte
}
func (dh *debugHasher) Write(b []byte) (int, error) {
dh.buf = append(dh.buf, b...)
return len(b), nil
}
func (dh *debugHasher) Sum(b []byte) []byte {
return nil
}
func (dh *debugHasher) Reset() {
// do nothing
}
func (dh *debugHasher) Size() int {
return 0
}
func (dh *debugHasher) BlockSize() int {
return sha256.BlockSize
}
func (dh *debugHasher) Println() {
fmt.Printf("---%s---\n", dh.buf)
}