net.http: make public errors and parse_form (#12038)

pull/12042/head
Anton Zavodchikov 2021-10-02 17:28:35 +05:00 committed by GitHub
parent 600880660a
commit 4c8094d0d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -226,7 +226,7 @@ fn parse_request_line(s string) ?(Method, urllib.URL, Version) {
} }
// Parse URL encoded key=value&key=value forms // 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('&') words := body.split('&')
mut form := map[string]string{} mut form := map[string]string{}
for word in words { for word in words {
@ -251,12 +251,14 @@ pub:
data string data string
} }
struct UnexpectedExtraAttributeError { pub struct UnexpectedExtraAttributeError {
pub:
msg string msg string
code int code int
} }
struct MultiplePathAttributesError { pub struct MultiplePathAttributesError {
pub:
msg string = 'Expected at most one path attribute' msg string = 'Expected at most one path attribute'
code int code int
} }