-
Notifications
You must be signed in to change notification settings - Fork 49
do_httpx3: Use of uninitialized value $headers in split ... #490
Copy link
Copy link
Open
Description
This perl warning happens when the server returns an empty response.
I'd suggest following patch:
index 3838b59..a25944b 100644
--- a/SSLeay.pm
+++ b/SSLeay.pm-1.94-do_httpx3-patch
@@ -1800,6 +1800,7 @@ sub do_httpx3 {
return (undef, "HTTP/1.0 900 NET OR SSL ERROR$CRLF$CRLF$errs") if $errs;
$http = '' if !defined $http;
+ $http = "\n" if '' eq $http; # to avoid "Use of uninitialized value $headers in split ..." below if httpx_cat() returned empty content
($headers, $page) = split /\s?\n\s?\n/, $http, 2;
warn "headers >$headers< page >>$page<< http >>>$http<<<" if $trace>1;
($response, $headers) = split /\s?\n/, $headers, 2;
To be improved in many ways, as this change may have side effects when headers are used elsewhere; I didn't search at other places in the code ...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels