Last active
December 14, 2015 22:19
-
-
Save tchn/5157904 to your computer and use it in GitHub Desktop.
patch for We-Sorrow to support basic auth request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -rupN Wsorrow.orig/Wsorrow.pl Wsorrow/Wsorrow.pl | |
--- Wsorrow.orig/Wsorrow.pl 2013-02-15 16:41:18.000000000 +0900 | |
+++ Wsorrow/Wsorrow.pl 2013-03-14 01:41:48.240744685 +0900 | |
@@ -27,6 +27,7 @@ BEGIN { # it seems to load faster. plus | |
use LWP::ConnCache; | |
use HTTP::Request; | |
use HTTP::Response; | |
+ use MIME::Base64; | |
use Getopt::Long qw( GetOptions ); | |
use Socket qw( inet_aton ); | |
use encoding 'UTF-8'; | |
@@ -80,8 +81,13 @@ BEGIN { # it seems to load faster. plus | |
"reject=i" => \my $RejectCode, # reject this code | |
"flag=s" => \my $Flag, # warn user when supplied content is found | |
"nyan" => \my $nyancat, # a prize for those who read the source | |
+ "user=s" => \my $upw, # username:passwd for Basic authentication | |
); | |
+ if(defined $upw) { | |
+ $ua->default_header('Authorization' => 'Basic ' . encode_base64($upw)); | |
+ } | |
+ | |
# usage | |
if($Host eq "none") { | |
@@ -1550,4 +1556,4 @@ sub SmallFdEnum{ | |
} | |
close(SmallFDEnum); | |
-} | |
\ No newline at end of file | |
+} | |
Binary files Wsorrow.orig/.Wsorrow.pl.swp and Wsorrow/.Wsorrow.pl.swp differ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment