chore: finalize lab7 security verification
CI / verify (pull_request) Failing after 41s

This commit is contained in:
2026-11-06 21:43:57 +03:00
parent 5ac64f51fa
commit 7716dc051e
41 changed files with 775 additions and 150 deletions
-17
View File
@@ -6,7 +6,6 @@ import (
"mime"
"net/http"
"net/url"
"regexp"
"strconv"
"strings"
"time"
@@ -153,22 +152,6 @@ func attachmentVariant(query url.Values) (string, bool) {
}
}
var traceparentPattern = regexp.MustCompile(`^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$`)
func traceparent(value string) string {
if traceparentPattern.MatchString(value) {
return value
}
return ""
}
func tracestate(value string) string {
if len(value) <= 512 {
return value
}
return ""
}
func attachmentIDFromRequest(r *http.Request) (string, *apiError) {
parts := strings.Split(strings.Trim(r.URL.Path, "/"), "/")
attachmentID, valid := canonicalID(parts[3])