From 90ab5d2cdb3bd67e4f7e05f180cbea72f06b99c5 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Fri, 9 May 2025 11:00:50 +0300 Subject: [PATCH] veb: allow route methods, that are tagged with `@[unsafe]` --- vlib/veb/parse.v | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vlib/veb/parse.v b/vlib/veb/parse.v index f854f33bcb..b1f0f39907 100644 --- a/vlib/veb/parse.v +++ b/vlib/veb/parse.v @@ -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)