From 4c8094d0d9c9d22c35c04afa9a8fcd2d41e88bb8 Mon Sep 17 00:00:00 2001 From: Anton Zavodchikov Date: Sat, 2 Oct 2021 17:28:35 +0500 Subject: [PATCH] net.http: make public errors and parse_form (#12038) --- vlib/net/http/request.v | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vlib/net/http/request.v b/vlib/net/http/request.v index 104a8122c1..75690b4d76 100644 --- a/vlib/net/http/request.v +++ b/vlib/net/http/request.v @@ -226,7 +226,7 @@ fn parse_request_line(s string) ?(Method, urllib.URL, Version) { } // Parse URL encoded key=value&key=value forms -fn parse_form(body string) map[string]string { +pub fn parse_form(body string) map[string]string { words := body.split('&') mut form := map[string]string{} for word in words { @@ -251,12 +251,14 @@ pub: data string } -struct UnexpectedExtraAttributeError { +pub struct UnexpectedExtraAttributeError { +pub: msg string code int } -struct MultiplePathAttributesError { +pub struct MultiplePathAttributesError { +pub: msg string = 'Expected at most one path attribute' code int }