Skip to content

Instantly share code, notes, and snippets.

@s1037989
Last active November 30, 2022 03:54
Show Gist options
  • Save s1037989/b60c41246838a45d9251ea997e2988a7 to your computer and use it in GitHub Desktop.
Save s1037989/b60c41246838a45d9251ea997e2988a7 to your computer and use it in GitHub Desktop.
$ mojo version
CORE
  Perl        (v5.34.0, linux)
  Mojolicious (9.30, Waffle)

OPTIONAL
  Cpanel::JSON::XS 4.09+   (n/a)
  EV 4.32+                 (n/a)
  IO::Socket::Socks 0.64+  (n/a)
  IO::Socket::SSL 2.009+   (n/a)
  Net::DNS::Native 0.15+   (n/a)
  Role::Tiny 2.000001+     (2.002004)
  Future::AsyncAwait 0.52+ (n/a)

This version is up to date, have fun!

Path remains encoded when the string to be parsed includes a scheme

$ perl -Mojo -E 'say l("http://abc.com:80/a/b/c/http%3A%2F%2Fabc.com%3A81%2Fa%2Fb%2Fc?abc#abc")->to_abs'
http://abc.com:80/a/b/c/http%3A%2F%2Fabc.com%3A81%2Fa%2Fb%2Fc?abc#abc

Path is decoded when the string to be parse does not include a scheme

$ perl -Mojo -E 'say l("/a/b/c/http%3A%2F%2Fabc.com%3A81%2Fa%2Fb%2Fc?abc#abc")->to_abs'
/a/b/c/http://abc.com:81/a/b/c?abc#abc

Using the base example from Mojo::URL doc, is this to be expected?

$ perl -Mojo -E 'say Mojo::URL->new("/a/b/http%3A%2F%2Fabc?c")->base(Mojo::URL->new("http://example.com"))->to_abs'
http://example.com/a/b/http://abc?c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment