File tree Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -227,7 +227,7 @@ namespace web {
227227 // / Creates a URI from the given URI components.
228228 // / </summary>
229229 // / <param name="components">A URI components object to create the URI instance.</param>
230- _ASYNCRTIMP uri (const details::uri_components &components) : m_components(components) { m_uri = m_components. join (); }
230+ _ASYNCRTIMP uri (const details::uri_components &components);
231231
232232 // / <summary>
233233 // / Creates a URI from the given encoded string. This will throw an exception if the string
Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ class http_headers
159159 {
160160 if (has (name))
161161 {
162- m_headers[name] = m_headers[name] .append (_XPLATSTR (" , " )).append (utility::conversions::print_string (value));
162+ m_headers[name].append (_XPLATSTR (" , " )).append (utility::conversions::print_string (value));
163163 }
164164 else
165165 {
Original file line number Diff line number Diff line change @@ -238,7 +238,7 @@ namespace web
238238 uri_builder &append_query (const utility::string_t &name, const T &value, bool do_encoding = true )
239239 {
240240 auto encodedName = name;
241- auto encodedValue = ::utility::conversions::print_string (value);
241+ auto encodedValue = ::utility::conversions::print_string (value, std::locale::classic () );
242242
243243 if (do_encoding)
244244 {
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ utility::string_t uri_components::join()
7373
7474 if (m_port > 0 )
7575 {
76- ret.append ({ _XPLATSTR (' :' ) }).append (utility::conversions::print_string (m_port));
76+ ret.append ({ _XPLATSTR (' :' ) }).append (utility::conversions::print_string (m_port, std::locale::classic () ));
7777 }
7878 }
7979
@@ -104,6 +104,15 @@ utility::string_t uri_components::join()
104104
105105using namespace details ;
106106
107+ uri::uri (const details::uri_components &components) : m_components(components)
108+ {
109+ m_uri = m_components.join ();
110+ if (!details::uri_parser::validate (m_uri))
111+ {
112+ throw uri_exception (" provided uri is invalid: " + utility::conversions::to_utf8string (m_uri));
113+ }
114+ }
115+
107116uri::uri (const utility::string_t &uri_string)
108117{
109118 if (!details::uri_parser::parse (uri_string, m_components))
You can’t perform that action at this time.
0 commit comments