veb: allow route methods, that are tagged with @[unsafe]

This commit is contained in:
Delyan Angelov 2025-05-09 11:00:50 +03:00
parent 656afa9d13
commit 90ab5d2cdb
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -18,6 +18,10 @@ fn parse_attrs(name string, attrs []string) !([]http.Method, string, string) {
attr := x[i]
attru := attr.to_upper()
m := http.method_from_str(attru)
if attru == 'UNSAFE' {
x.delete(i)
continue
}
if attru == 'GET' || m != .get {
methods << m
x.delete(i)