ConnMan network manager
 help / color / mirror / Atom feed
From: Giuseppe Eletto <giuseppe.eletto98@gmail.com>
To: connman@lists.linux.dev
Cc: Giuseppe Eletto <giuseppe.eletto98@gmail.com>
Subject: [PATCH 2/2] wispr: Use lowercase header field names in g_web_result_get_header calls
Date: Tue,  7 Jul 2026 11:16:45 +0200	[thread overview]
Message-ID: <20260707091645.90508-3-giuseppe.eletto98@gmail.com> (raw)
In-Reply-To: <20260707091645.90508-1-giuseppe.eletto98@gmail.com>

Following the normalization of received header field names to
lowercase in gweb, update all g_web_result_get_header call sites
in src/wispr.c and tools/wispr.c to pass lowercase names.

This avoids the allocation inside g_web_result_get_header
on the common path, and keeps call sites consistent with the
normalized store.

Signed-off-by: Giuseppe Eletto <giuseppe.eletto98@gmail.com>
---
 src/wispr.c   | 12 ++++++------
 tools/wispr.c |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/wispr.c b/src/wispr.c
index a40cf353..f7da6426 100644
--- a/src/wispr.c
+++ b/src/wispr.c
@@ -708,19 +708,19 @@ static void portal_manage_success_status(GWebResult *result,
 	DBG("");
 
 	/* We currently don't do anything with this info */
-	if (g_web_result_get_header(result, "X-ConnMan-Client-IP",
+	if (g_web_result_get_header(result, "x-connman-client-ip",
 				&str))
 		connman_info("Client-IP: %s", str);
 
-	if (g_web_result_get_header(result, "X-ConnMan-Client-Country",
+	if (g_web_result_get_header(result, "x-connman-client-country",
 				&str))
 		connman_info("Client-Country: %s", str);
 
-	if (g_web_result_get_header(result, "X-ConnMan-Client-Region",
+	if (g_web_result_get_header(result, "x-connman-client-region",
 				&str))
 		connman_info("Client-Region: %s", str);
 
-	if (g_web_result_get_header(result, "X-ConnMan-Client-Timezone",
+	if (g_web_result_get_header(result, "x-connman-client-timezone",
 				&str))
 		connman_info("Client-Timezone: %s", str);
 
@@ -1081,7 +1081,7 @@ static void wispr_portal_web_result_success(GWebResult *result,
 		if (wp_context->wispr_msg.message_type >= 0)
 			break;
 
-		if (g_web_result_get_header(result, "X-ConnMan-Status",
+		if (g_web_result_get_header(result, "x-connman-status",
 						&str)) {
 			portal_manage_success_status(result, wp_context);
 		} else {
@@ -1099,7 +1099,7 @@ static void wispr_portal_web_result_success(GWebResult *result,
 	case GWEB_HTTP_STATUS_CODE_TEMPORARY_REDIRECT:
 	case GWEB_HTTP_STATUS_CODE_PERMANENT_REDIRECT:
 		if (!g_web_supports_tls() ||
-			!g_web_result_get_header(result, "Location",
+			!g_web_result_get_header(result, "location",
 							&redirect)) {
 
 			wispr_portal_context_ref(wp_context);
diff --git a/tools/wispr.c b/tools/wispr.c
index 0c794ccb..810958e8 100644
--- a/tools/wispr.c
+++ b/tools/wispr.c
@@ -524,7 +524,7 @@ static bool wispr_result(const GError *error, GWebResult *result, gpointer user_
 		if (status != 302)
 			goto done;
 
-		if (!g_web_result_get_header(result, "Location", &redirect))
+		if (!g_web_result_get_header(result, "location", &redirect))
 			goto done;
 
 		printf("Redirect URL: %s\n", redirect);
@@ -583,7 +583,7 @@ static bool wispr_result(const GError *error, GWebResult *result, gpointer user_
 	if (status == 302) {
 		const char *redirect;
 
-		if (!g_web_result_get_header(result, "Location", &redirect))
+		if (!g_web_result_get_header(result, "location", &redirect))
 			goto done;
 
 		printf("\n");
-- 
2.50.1


  parent reply	other threads:[~2026-07-07  9:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-07  9:16 [PATCH 0/2] gweb/wispr: Normalize received HTTP header field names Giuseppe Eletto
2026-07-07  9:16 ` [PATCH 1/2] gweb: Normalize received HTTP header field names to lowercase Giuseppe Eletto
2026-07-07  9:16 ` Giuseppe Eletto [this message]
2026-07-07 15:37 ` [PATCH 0/2] gweb/wispr: Normalize received HTTP header field names Grant Erickson

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=20260707091645.90508-3-giuseppe.eletto98@gmail.com \
    --to=giuseppe.eletto98@gmail.com \
    --cc=connman@lists.linux.dev \
    /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