bare-url 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-url",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "WHATWG URL implementation for JavaScript",
5
5
  "main": "index.js",
6
6
  "files": [
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -881,12 +881,12 @@ url__parse (url_t *url, const utf8_string_view_t input, const url_t *base) {
881
881
  } else {
882
882
  utf8_string_view_t host = url_get_host(base);
883
883
 
884
- if (!utf8_string_view_empty(host)) {
885
- if (url->type == url_type_opaque) {
886
- err = utf8_string_append_literal(&url->href, (utf8_t *) "//", 2);
887
- if (err < 0) goto err;
888
- }
884
+ if (url->type == url_type_opaque && base->components.scheme_end + 3 /* :// */ == base->components.host_start) {
885
+ err = utf8_string_append_literal(&url->href, (utf8_t *) "//", 2);
886
+ if (err < 0) goto err;
887
+ }
889
888
 
889
+ if (!utf8_string_view_empty(host)) {
890
890
  utf8_string_view_t username = url_get_username(base);
891
891
 
892
892
  if (!utf8_string_view_empty(username)) {
@@ -43,7 +43,8 @@ utf8_string_init (utf8_string_t *string) {
43
43
 
44
44
  inline utf8_string_view_t
45
45
  utf8_string_view_init (const utf8_t *data, size_t len) {
46
- return (utf8_string_view_t){data, len};
46
+ utf8_string_view_t view = {data, len};
47
+ return view;
47
48
  }
48
49
 
49
50
  inline void