forked from mtusi2026/mtusi2026lab3
work 3
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
package validate
|
||||
|
||||
import "regexp"
|
||||
|
||||
var idempotencyKeyPattern = regexp.MustCompile(`^[A-Za-z0-9._:-]{1,128}$`)
|
||||
|
||||
func IdempotencyKey(s string) error {
|
||||
if !idempotencyKeyPattern.MatchString(s) {
|
||||
return newError("Idempotency-Key", "must match [A-Za-z0-9._:-]{1,128}")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user