forked from forgejo/forgejo
Clean up some variable declarations
This commit is contained in:
parent
65016b2664
commit
1da0d49de7
4 changed files with 19 additions and 24 deletions
|
@ -23,7 +23,7 @@ import (
|
|||
|
||||
const (
|
||||
// ActivityStreamsContentType const
|
||||
ActivityStreamsContentType = "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\""
|
||||
ActivityStreamsContentType = `application/ld+json; profile="https://www.w3.org/ns/activitystreams"`
|
||||
)
|
||||
|
||||
func containsRequiredHTTPHeaders(method string, headers []string) error {
|
||||
|
@ -31,13 +31,13 @@ func containsRequiredHTTPHeaders(method string, headers []string) error {
|
|||
for _, header := range headers {
|
||||
hasRequestTarget = hasRequestTarget || header == httpsig.RequestTarget
|
||||
hasDate = hasDate || header == "Date"
|
||||
hasDigest = method == "GET" || hasDigest || header == "Digest"
|
||||
hasDigest = hasDigest || header == "Digest"
|
||||
}
|
||||
if !hasRequestTarget {
|
||||
return fmt.Errorf("missing http header for %s: %s", method, httpsig.RequestTarget)
|
||||
} else if !hasDate {
|
||||
return fmt.Errorf("missing http header for %s: Date", method)
|
||||
} else if !hasDigest {
|
||||
} else if !hasDigest && method != http.MethodGet {
|
||||
return fmt.Errorf("missing http header for %s: Digest", method)
|
||||
}
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue