From: Michael R Sweet Date: Sun, 10 Jul 2022 15:53:41 +0000 (-0400) Subject: Localize the HTTP response using the Content-Language value (Issue #426) X-Git-Tag: v2.4.3~165 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02c6a72c2fa394385b34d8c45e7a9ae2a012d17a;p=thirdparty%2Fcups.git Localize the HTTP response using the Content-Language value (Issue #426) --- diff --git a/CHANGES.md b/CHANGES.md index bf844e491d..11b5fd0732 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,9 +6,11 @@ Changes in CUPS v2.4.3 (TBA) - Added a title with device uri for found network printers (Issues #402, #393) - Fixed configuration on RISC-V machines (Issue #404) -- Fixed the `device_uri` invalid pointer for driverless printers with `.local` hostname (Issue #419) +- Fixed the `device_uri` invalid pointer for driverless printers with `.local` + hostname (Issue #419) - Fixed an OpenSSL crash bug (Issue #409) - Use localhost when printing via printer application (Issue #353) +- Now localize HTTP responses using the Content-Language value (Issue #426) Changes in CUPS v2.4.2 (26th May 2022) diff --git a/cups/http.c b/cups/http.c index ecc3dab8ee..8a06daf676 100644 --- a/cups/http.c +++ b/cups/http.c @@ -3349,6 +3349,7 @@ httpWriteResponse(http_t *http, /* I - HTTP connection */ { http_encoding_t old_encoding; /* Old data_encoding value */ off_t old_remaining; /* Old data_remaining value */ + cups_lang_t *lang; /* Response language */ /* @@ -3420,6 +3421,12 @@ httpWriteResponse(http_t *http, /* I - HTTP connection */ "identity"); #endif /* HAVE_LIBZ */ + /* + * Get the response language, if any... + */ + + lang = cupsLangGet(http->fields[HTTP_FIELD_CONTENT_LANGUAGE]); + /* * Send the response header... */ @@ -3428,7 +3435,7 @@ httpWriteResponse(http_t *http, /* I - HTTP connection */ old_remaining = http->data_remaining; http->data_encoding = HTTP_ENCODING_FIELDS; - if (httpPrintf(http, "HTTP/%d.%d %d %s\r\n", http->version / 100, http->version % 100, (int)status, httpStatus(status)) < 0) + if (httpPrintf(http, "HTTP/%d.%d %d %s\r\n", http->version / 100, http->version % 100, (int)status, _httpStatus(lang, status)) < 0) { http->status = HTTP_STATUS_ERROR; return (-1);