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 {
227
227
// / Creates a URI from the given URI components.
228
228
// / </summary>
229
229
// / <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);
231
231
232
232
// / <summary>
233
233
// / 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
159
159
{
160
160
if (has (name))
161
161
{
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));
163
163
}
164
164
else
165
165
{
Original file line number Diff line number Diff line change @@ -238,7 +238,7 @@ namespace web
238
238
uri_builder &append_query (const utility::string_t &name, const T &value, bool do_encoding = true )
239
239
{
240
240
auto encodedName = name;
241
- auto encodedValue = ::utility::conversions::print_string (value);
241
+ auto encodedValue = ::utility::conversions::print_string (value, std::locale::classic () );
242
242
243
243
if (do_encoding)
244
244
{
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ utility::string_t uri_components::join()
73
73
74
74
if (m_port > 0 )
75
75
{
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 () ));
77
77
}
78
78
}
79
79
@@ -104,6 +104,15 @@ utility::string_t uri_components::join()
104
104
105
105
using namespace details ;
106
106
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
+
107
116
uri::uri (const utility::string_t &uri_string)
108
117
{
109
118
if (!details::uri_parser::parse (uri_string, m_components))
You can’t perform that action at this time.
0 commit comments