Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump HTTP::Daemon test dependency to 6.12 #300

Merged
merged 3 commits into from
Jun 8, 2020
Merged

Conversation

oalders
Copy link
Member

@oalders oalders commented May 26, 2020

No description provided.

@coveralls
Copy link

coveralls commented May 26, 2020

Pull Request Test Coverage Report for Build 360

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 94.279%

Totals Coverage Status
Change from base Build 347: 0.0%
Covered Lines: 758
Relevant Lines: 804

💛 - Coveralls

@skaji
Copy link
Member

skaji commented May 27, 2020

HTTP::Daemon 6.10 returns a correct $d->url so that we don't need workarounds anymore:

my $url = URI->new($d->url);
if ($d->sockdomain == Socket::AF_INET) {
$url->host( '127.0.0.1' );
} elsif ($d->sockdomain == Socket::AF_INET6) {
$url->host( '[::1]' );
} else {
die "unexpected sockdomain: " . $d->sockdomain;
}

my $lhurl = URI::URL->new( $d->url );
if ($d->sockdomain == Socket::AF_INET) {
$lhurl->host( '127.0.0.1' );
} elsif ($d->sockdomain == Socket::AF_INET6) {
$lhurl->host( '[::1]' );
} else {
die "unexpected sockdomain: " . $d->sockdomain;
}

@oalders Could you remove these lines?

@oalders
Copy link
Member Author

oalders commented May 27, 2020

@skaji I have removed the lines. Is that what you had in mind?

Copy link
Member

@skaji skaji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oalders Thank you. LGTM

FYI: We don't need Socket or URI module anymore, so you may want to remove them.

diff --git t/local/log-server t/local/log-server
index a77b1e6..c280cdd 100644
--- t/local/log-server
+++ t/local/log-server
@@ -3,7 +3,6 @@ use strict;
 use HTTP::Daemon ();
 use CGI 4.08;
 use Getopt::Long;
-use Socket ();
 
 $|++;
 
@@ -13,8 +12,7 @@ GetOptions(
 
 my $d = HTTP::Daemon->new or die;
 
-my $url = URI->new($d->url);
-print "$url\n";
+print $d->url, "\n";
 
 my ($filename,$logfile) = @ARGV[0,1];
 if ($filename) {
diff --git t/local/referer-server t/local/referer-server
index a6f206b..9ecd393 100644
--- t/local/referer-server
+++ t/local/referer-server
@@ -1,14 +1,11 @@
 # Thanks to merlyn for nudging me and giving me this snippet!
 
 use HTTP::Daemon ();
-use URI::URL;
-use Socket ();
 
 $|++;
 
 my $d = HTTP::Daemon->new or die;
-my $lhurl = URI::URL->new( $d->url );
-print $lhurl->as_string, "\n";
+print $d->url, "\n";
 
 $counter = 5;
 while ($counter-- and my $c = $d->accept) {

@oalders
Copy link
Member Author

oalders commented May 29, 2020

Thanks @skaji. I've applied your diff in 44649ef

@oalders oalders changed the title Bump HTTP::Daemon test dependency to 6.10 Bump HTTP::Daemon test dependency to 6.12 Jun 8, 2020
@oalders oalders merged commit 7a3527d into master Jun 8, 2020
@oalders oalders deleted the oalders/http-daemon branch June 8, 2020 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants