Operating system: Linux OpenSUSE Leap 15.5 (5.14.21-150500.55.39-default)
Steps to reproduce the behavior
#! /usr/bin/perl
use warnings;
use strict;
use feature qw{ say };
use Mojo::Message::Request;
use Mojo::URL;
my $url1 = 'Mojo::URL'->new('http://example.com');
say $url1->to_string, ' ', $url1->is_abs ? 'abs' : '!abs'; # Is absolute.
my $txt = join "\r\n", 'GET / HTTP/1.1', 'Host: example.com', "", "";
my $url2 = 'Mojo::Message::Request'->new->parse($txt)->url;
say $url2->to_string, ' ', $url2->is_abs ? 'abs' : '!abs'; # Isn't absolute!
Expected behavior
$url2 should be absolute.
Actual behavior
$url2 is not absolute.
This leads to unexpected behaviour: when a serialised (to_string) request is parsed into a request and this request is started, it fails.
See this StackOverflow question.
Steps to reproduce the behavior
Expected behavior
$url2
should be absolute.Actual behavior
$url2
is not absolute.This leads to unexpected behaviour: when a serialised (
to_string
) request is parsed into a request and this request isstart
ed, it fails. See this StackOverflow question.