GNU bug report logs - #70308
[PATCH] guix: http tests: Log bad requests.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Nicolas Graves <ngraves@HIDDEN>; Keywords: patch; Done: Nicolas Graves <ngraves@HIDDEN>; Maintainer for guix-patches is guix-patches@HIDDEN.
bug closed, send any further explanations to 70308 <at> debbugs.gnu.org and Nicolas Graves <ngraves@HIDDEN> Request was from Nicolas Graves <ngraves@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 9 Apr 2024 11:07:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 09 07:07:17 2024
Received: from localhost ([127.0.0.1]:48462 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ru9Jr-0008Su-TC
	for submit <at> debbugs.gnu.org; Tue, 09 Apr 2024 07:07:17 -0400
Received: from lists.gnu.org ([2001:470:142::17]:40672)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ngraves@HIDDEN>) id 1ru9Jf-0008Re-Mt
 for submit <at> debbugs.gnu.org; Tue, 09 Apr 2024 07:07:14 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ngraves@HIDDEN>)
 id 1ru9JO-0002pO-7l
 for guix-patches@HIDDEN; Tue, 09 Apr 2024 07:06:47 -0400
Received: from 1.mo560.mail-out.ovh.net ([46.105.63.121])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ngraves@HIDDEN>)
 id 1ru9JK-0004xJ-EC
 for guix-patches@HIDDEN; Tue, 09 Apr 2024 07:06:45 -0400
Received: from director2.ghost.mail-out.ovh.net (unknown [10.108.25.248])
 by mo560.mail-out.ovh.net (Postfix) with ESMTP id 4VDNSY3rQJz1SmQ
 for <guix-patches@HIDDEN>; Tue,  9 Apr 2024 11:06:37 +0000 (UTC)
Received: from ghost-submission-6684bf9d7b-5j9bm (unknown [10.111.182.240])
 by director2.ghost.mail-out.ovh.net (Postfix) with ESMTPS id EA2381FD7A;
 Tue,  9 Apr 2024 11:06:35 +0000 (UTC)
Received: from ngraves.fr ([37.59.142.110])
 by ghost-submission-6684bf9d7b-5j9bm with ESMTPSA
 id 5zxSLDshFWbjcQ0A5fxlpg
 (envelope-from <ngraves@HIDDEN>); Tue, 09 Apr 2024 11:06:35 +0000
Authentication-Results: garm.ovh; auth=pass
 (GARM-110S004580f7955-ada2-490e-994b-6e2b8ed4fd8d,
 E694A2EEB8DE3E60D9283BD588F72EE4EA3BAC6A) smtp.auth=ngraves@HIDDEN
X-OVh-ClientIp: 81.67.146.208
From: Nicolas Graves <ngraves@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] guix: http tests: Log bad requests.
Date: Tue,  9 Apr 2024 13:06:32 +0200
Message-ID: <20240409110632.31710-1-ngraves@HIDDEN>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Ovh-Tracer-Id: 2395070579422782178
X-VR-SPAMSTATE: OK
X-VR-SPAMSCORE: 0
X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrudehtddgtdejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepkeffgeetfffgffejgeejvdffgfdtvdeuueetgfefuedvjeegvdegjeejveeuueevnecukfhppeduvdejrddtrddtrddupdekuddrieejrddugeeirddvtdekpdefjedrheelrddugedvrdduuddtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopehguhhigidqphgrthgthhgvshesghhnuhdrohhrghdpoffvtefjohhsthepmhhoheeitddpmhhouggvpehsmhhtphhouhht
Received-SPF: pass client-ip=46.105.63.121; envelope-from=ngraves@HIDDEN;
 helo=1.mo560.mail-out.ovh.net
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H3=0.001,
 RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
Cc: ngraves@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

* guix/test/http.scm (call-with-http-server): Log bad requests to make
debugging easier.

Change-Id: I2bb7231db1e5cd9a6e1c4cf76d256fa7c9e50776
---
 guix/tests/http.scm | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/guix/tests/http.scm b/guix/tests/http.scm
index 17485df9ef..e02f91923c 100644
--- a/guix/tests/http.scm
+++ b/guix/tests/http.scm
@@ -132,8 +132,10 @@ (define-server-impl stub-http-server
     http-write
     (@@ (web server http) http-close))
 
-  (define bad-request
-    (build-response #:code 400 #:reason-phrase "Unexpected request"))
+  (define (bad-request req)
+    (build-response
+     #:code 400
+     #:reason-phrase (string-append "Unexpected request: " req)))
 
   (define (server-body)
     (define (handle request body)
@@ -144,7 +146,7 @@ (define (handle request body)
         ((((? string?) response data) ...)
          (let ((path (uri-path (request-uri request))))
            (match (assoc path responses)
-             (#f (values bad-request ""))
+             (#f (values (bad-request path) ""))
              ((_ response data)
               (if (eq? 'GET (request-method request))
                   ;; Note: Use 'assoc-remove!' to remove only the first entry
@@ -153,7 +155,7 @@ (define (handle request body)
                   (let ((rest (assoc-remove! responses path)))
                     (set! responses rest)
                     (values response data))
-                  (values bad-request ""))))))))
+                  (values (bad-request path) ""))))))))
 
     (let-values (((socket port) (open-http-server-socket)))
       (set! %http-real-server-port port)
-- 
2.41.0





Acknowledgement sent to Nicolas Graves <ngraves@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#70308; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 9 Apr 2024 11:30:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.