[PATCH 2/2] wispr: Use lowercase header field names in g_web_result_get_header calls
Giuseppe Eletto <[email protected]> Tue, 7 Jul 2026 11:16:45 +0200
| Newsgroups | dev.linux.lists.connman |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]> --- 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