git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] http: fix v1 protocol tests with apache httpd < 2.4

From
Todd Zullinger <tmz@pobox.com>
Date
Jan 3, 2018, 16:21 UTC
Message-ID
<20180103162146.GJ12108@zaya.teonanacatl.net>
In-Reply-To
<20180103061703.GB25752@sigill.intra.peff.net>
Jeff King wrote:
Show 28 quoted lines
> On Tue, Jan 02, 2018 at 07:39:46PM -0500, Todd Zullinger wrote:
>> I don't know if there's a clean way to do that
>> automatically, short of parsing the output of 'httpd -v'
>> should we ever need to add such a prereq.
> 
> In the general case, we could probably define an endpoint within an <If>
> block, and then try to access the endpoint from the test script.
> 
> E.g., something like:
> 
>     <IfVersion >= 2.4>
>     Alias /have-2.4.txt www/yes.txt
>     </IfVersion>
> 
> in the apache config, and then:
> 
>   test_lazy_prereq APACHE24 '
>         echo yes >"$HTTPD_DOCUMENT_ROOT_PATH/yes.txt" &&
>         curl -f "$HTTPD_URL/have-2.4.txt"
>   '
> 
> in the test script (of course we may not want to depend on having
> command-line curl, but we could replace that with "git ls-remote" or
> similar).
> 
> One nice thing about that approach is that it can be extended to other
> "If" blocks, like if we have a particular module available, or if ssl is
> configured.

That's quite elegant. I even modified an IfVersion block and didn't think about using it that way to create a prereq. Neat!

-- 
Todd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You're not drunk if you can lie on the floor without holding on.
    -- Dean Martin
Previous: Jeff KingNext: Jeff King
Message 5 of 6 in “http: fix v1 protocol tests with apache httpd < 2.4”
  1. http: fix v1 protocol tests with apache httpd < 2.4Todd Zullinger, Dec 31, 2017
  2. Brandon WilliamsJan 3, 2018
  3. Todd ZullingerJan 3, 2018
  4. Jeff KingJan 3, 2018
  5. Todd ZullingerJan 3, 2018
  6. Jeff KingJan 3, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.