mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-17 21:53:42 +08:00
🔖 chore: Remove invalid code
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user