public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Noah Sanci <nsanci@redhat.com>
To: elfutils-devel@sourceware.org
Subject: Re: debuginfod: Query debuginfod servers before printing response
Date: Fri, 17 Sep 2021 13:38:50 -0400	[thread overview]
Message-ID: <CAJXA7qi8Le-w4ZXkLfEfHW7xud3Ped3D9iwJ5FVfQFDw4=pKGw@mail.gmail.com> (raw)
In-Reply-To: <49932c2202b51969a8ee36648494eb0fa9e73dee.camel@klomp.org>

[-- Attachment #1: Type: text/plain, Size: 248 bytes --]

Hello,

Here is an updated patch, removing checks for http response headers
which debuginfod is not guaranteed
to respond with. These headers caused tests to fail despite receiving
sufficient headers to confirm functionality.

Regards,

Noah Sanci

[-- Attachment #2: 0001-debuginfod-Remove-checking-for-unsafe-headers.patch --]
[-- Type: text/x-patch, Size: 2443 bytes --]

From 28db5f16c44fa7bbd24b221b65aa4d133753355c Mon Sep 17 00:00:00 2001
From: Noah Sanci <nsanci@redhat.com>
Date: Fri, 17 Sep 2021 10:45:39 -0400
Subject: [PATCH] debuginfod: Remove checking for unsafe headers

Some http response header checks were removed such as checking for
Connection and Cache-Control. These headers are not guarenteed to be
received and depend on proxy and libmicrohttpd versions. Checking for
the existance of Content-Length and DEBUGINFOD-* headers is sufficient
since Content-Length is added upon creation of an MHD_Response object
and DEBUGINFOD-* are added manually.
(source on Content-Length being added:
https://www.gnu.org/software/libmicrohttpd/manual/libmicrohttpd.html#
    microhttpd_002dresponse-headers )

Signed-off-by: Noah Sanci <nsanci@redhat.com>
---
 tests/ChangeLog                          | 5 +++++
 tests/run-debuginfod-response-headers.sh | 4 ----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/tests/ChangeLog b/tests/ChangeLog
index c73f2534..b62bb350 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,8 @@
+2021-09-17  Noah Sanci  <nsanci@redhat.com>
+
+	* run-debuginfod-response-header.sh: removed checking for Connection
+	and Cache-Control in response headers.
+
 2021-09-08  Mark Wielaard  <mark@klomp.org>
 
 	* run-varlocs-vars.sh: New test.
diff --git a/tests/run-debuginfod-response-headers.sh b/tests/run-debuginfod-response-headers.sh
index bdb39b4d..10b2ab49 100755
--- a/tests/run-debuginfod-response-headers.sh
+++ b/tests/run-debuginfod-response-headers.sh
@@ -74,8 +74,6 @@ env DEBUGINFOD_URLS="http://127.0.0.1:"$PORT1 LD_LIBRARY_PATH=$ldpath ${abs_top_
     -vvv executable F/prog > vlog-find$PORT1.1 2>&1
 tempfiles vlog-find$PORT1.1
 grep 'Content-Length: ' vlog-find$PORT1.1
-grep 'Connection: ' vlog-find$PORT1.1
-grep 'Cache-Control: ' vlog-find$PORT1.1
 grep 'X-DEBUGINFOD-FILE: ' vlog-find$PORT1.1
 grep 'X-DEBUGINFOD-SIZE: ' vlog-find$PORT1.1
 
@@ -84,8 +82,6 @@ env DEBUGINFOD_URLS="http://127.0.0.1:"$PORT1 LD_LIBRARY_PATH=$ldpath ${abs_top_
     -vvv executable c36708a78618d597dee15d0dc989f093ca5f9120 > vlog-find$PORT1.2 2>&1
 tempfiles vlog-find$PORT1.2
 grep 'Content-Length: ' vlog-find$PORT1.2
-grep 'Connection: ' vlog-find$PORT1.2
-grep 'Cache-Control: ' vlog-find$PORT1.2
 grep 'X-DEBUGINFOD-FILE: ' vlog-find$PORT1.2
 grep 'X-DEBUGINFOD-SIZE: ' vlog-find$PORT1.2
 grep 'X-DEBUGINFOD-ARCHIVE: ' vlog-find$PORT1.2
-- 
2.31.1


  reply	other threads:[~2021-09-17 17:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17 14:55 Noah Sanci
2021-09-17 15:06 ` Mark Wielaard
2021-09-17 17:38   ` Noah Sanci [this message]
2021-09-17 17:49     ` Mark Wielaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJXA7qi8Le-w4ZXkLfEfHW7xud3Ped3D9iwJ5FVfQFDw4=pKGw@mail.gmail.com' \
    --to=nsanci@redhat.com \
    --cc=elfutils-devel@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).