]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei_xsearch: use curl -d '' for nginx compatibility
authorEric Wong <e@80x24.org>
Sun, 24 Jan 2021 11:46:52 +0000 (04:46 -0700)
committerEric Wong <e@80x24.org>
Sun, 24 Jan 2021 19:45:31 +0000 (15:45 -0400)
It appears Content-Length and/or Content-Type headers are
required by nginx with POST requests.

varnish alone doesn't have this requirement and my (perhaps
lossy) reading of RFC 2616, 7230, 7231 didn't note this, either.

In any case, we must support nginx even if it's overly strict.

Reported-By: Kyle Meyer <kyle@kyleam.com>
Link: https://public-inbox.org/meta/87v9bmswkh.fsf@kyleam.com/
lib/PublicInbox/LeiXSearch.pm

index 0417db245d9ddb0a5e2995d53aba695e7a108d58..c6ff5679c5fb341fba42dff447c5948d9a9714cc 100644 (file)
@@ -191,7 +191,7 @@ sub query_remote_mboxrd {
        push(@qform, t => 1) if $opt->{thread};
        my $dedupe = $lei->{dedupe} // die 'BUG: {dedupe} missing';
        $dedupe->prepare_dedupe;
-       my @cmd = qw(curl -XPOST -sSf);
+       my @cmd = (qw(curl -sSf -d), '');
        my $verbose = $opt->{verbose};
        push @cmd, '-v' if $verbose;
        for my $o ($lei->curl_opt) {