Skip to content

Commit 90ab5d2

Browse files
committed
veb: allow route methods, that are tagged with @[unsafe]
1 parent 656afa9 commit 90ab5d2

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎vlib/veb/parse.v‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ fn parse_attrs(name string, attrs []string) !([]http.Method, string, string) {
1818
attr := x[i]
1919
attru := attr.to_upper()
2020
m := http.method_from_str(attru)
21+
if attru == 'UNSAFE' {
22+
x.delete(i)
23+
continue
24+
}
2125
if attru == 'GET' || m != .get {
2226
methods << m
2327
x.delete(i)

0 commit comments

Comments
 (0)