Skip Menu |

This queue is for tickets about the Catalyst-Runtime CPAN distribution.

Report information
The Basics
Id: 133155
Status: open
Priority: 0/
Queue: Catalyst-Runtime

People
Owner: Nobody in particular
Requestors: rrwo [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Catalyst::Test should set a User-Agent
Date: Thu, 13 Aug 2020 14:40:18 +0100
To: bug-Catalyst-Runtime [...] rt.cpan.org
From: Robert Rothenberg <rrwo [...] cpan.org>
This is a minor issue, and is easily worked-around by passing a custom HTTP::Request that contains a User-Agent, for code that requires it be set. But technically all HTTP requests should have one, so one should be set. This should be easily done in _customize_request by one line:   $request->header( "User-Agent" => "Catalyst::Test/${Catalyst::VERSION}" );
On 2020-08-13 06:40:26, RRWO wrote: Show quoted text
> This is a minor issue, and is easily worked-around by passing a custom > HTTP::Request that contains a User-Agent, for code that requires it be set. > > But technically all HTTP requests should have one, so one should be set. > This should be easily done in _customize_request by one line: > >   $request->header( "User-Agent" => > "Catalyst::Test/${Catalyst::VERSION}" );
I get that one SHOULD (in the RFC sense of the word) provide a User-Agent, but code should be able to handle the lack of one, as it is not a required header. (It looks like HTTP 1.0 requires no headers, and HTTP 1.1 only requires HOST.) What things are failing when this header is not populated?
Subject: Re: [rt.cpan.org #133155] Catalyst::Test should set a User-Agent
Date: Fri, 14 Aug 2020 09:41:48 +0100
To: bug-Catalyst-Runtime [...] rt.cpan.org, rrwo [...] cpan.org
From: Robert Rothenberg <robrwo [...] gmail.com>
On 14/08/2020 00:42, Karen Etheridge via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=133155 > > > On 2020-08-13 06:40:26, RRWO wrote:
>> This is a minor issue, and is easily worked-around by passing a custom >> HTTP::Request that contains a User-Agent, for code that requires it be set. >> >> But technically all HTTP requests should have one, so one should be set. >> This should be easily done in _customize_request by one line: >> >>   $request->header( "User-Agent" => >> "Catalyst::Test/${Catalyst::VERSION}" );
> I get that one SHOULD (in the RFC sense of the word) provide a User-Agent, but code should be able to handle the lack of one, as it is not a required header. (It looks like HTTP 1.0 requires no headers, and HTTP 1.1 only requires HOST.) > > What things are failing when this header is not populated?
Nothing "core" is failing. At $work we have some modified code that requires a user-agent header. (Basically, it's an easy way to filter out a large portion of the script kiddies.) It's an easy enough work-around in the tests, but it's tedious. The tests that are based on Test::WWW::Mechanize::{Catalyst,PSGI} don't have this problem, because WWW::Mechanize already sets the header.
On 2020-08-14 01:41:59, robrwo@gmail.com wrote: Show quoted text
> Nothing "core" is failing. At $work we have some modified code that > requires a user-agent header. (Basically, it's an easy way to filter > out > a large portion of the script kiddies.) It's an easy enough work- > around > in the tests, but it's tedious. > > The tests that are based on Test::WWW::Mechanize::{Catalyst,PSGI} > don't > have this problem, because WWW::Mechanize already sets the header.
I see, it's your internal tests that are failing? If your internal code has a requirement that the User-Agent be set, would it not be reasonable then that your internal tests make sure that the header is set when your application is used (and then they can also test what happens when it is not set)?
Subject: Re: [rt.cpan.org #133155] Catalyst::Test should set a User-Agent
Date: Tue, 1 Sep 2020 19:30:17 +0100
To: bug-Catalyst-Runtime [...] rt.cpan.org, rrwo [...] cpan.org
From: Robert Rothenberg <robrwo [...] gmail.com>
Yes, this is something related to internal tests, and fixable. I've pointed this out only because User-Agent is recommended. If you don't see it as worth changing, no problem. But it's probably worth adding a small note to the documentation stating that the User-Agent is unset. On 14/08/2020 17:51, Karen Etheridge via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=133155 > > > On 2020-08-14 01:41:59, robrwo@gmail.com wrote: >
>> Nothing "core" is failing. At $work we have some modified code that >> requires a user-agent header. (Basically, it's an easy way to filter >> out >> a large portion of the script kiddies.) It's an easy enough work- >> around >> in the tests, but it's tedious. >> >> The tests that are based on Test::WWW::Mechanize::{Catalyst,PSGI} >> don't >> have this problem, because WWW::Mechanize already sets the header.
> I see, it's your internal tests that are failing? > > If your internal code has a requirement that the User-Agent be set, would it not be reasonable then that your internal tests make sure that the header is set when your application is used (and then they can also test what happens when it is not set)? > >