memcpy (uri->string + u.field_data[UF_SCHEMA].len, "://", 3);
rspamd_strlcpy (uri->string + u.field_data[UF_SCHEMA].len + 3,
p + u.field_data[UF_SCHEMA].len + 1,
- len - 1 - u.field_data[UF_SCHEMA].len);
+ len - 2 - u.field_data[UF_SCHEMA].len);
/* Compensate slashes added */
for (i = UF_SCHEMA + 1; i < UF_MAX; i++) {
if (u.field_set & (1 << i)) {
{"http://twitter.com#test", true, {
host = 'twitter.com', fragment = 'test'
}},
+ {"http:www.twitter.com#test", true, {
+ host = 'www.twitter.com', fragment = 'test'
+ }},
}
-- Some cases from https://code.google.com/p/google-url/source/browse/trunk/src/url_canon_unittest.cc