Re: [PATCH 1/2] Append Content-Language on Accept-Language request



On Tue, 2011-05-24 at 18:42 +0200, Jens Georg wrote:
> This is not mandated by HTTP RFC's but the UPnP CTT requires this.
> ---
>  libgupnp/gupnp-context.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/libgupnp/gupnp-context.c b/libgupnp/gupnp-context.c
> index b13c9ab..7f8e19f 100644
> --- a/libgupnp/gupnp-context.c
> +++ b/libgupnp/gupnp-context.c
> @@ -835,6 +835,10 @@ host_path_handler (SoupServer        *server,
>          /* Set Content-Language */
>          if (locales)
>                 http_response_set_content_locale (msg, locales->data);
> +        else if (soup_message_headers_get_one (msg->request_headers,
> +                                               "Accept-Language"))
> +                soup_message_headers_append (msg->response_headers,
> +                                             "Content-Language", "en");
>  
>          /* Set Accept-Ranges */
>          soup_message_headers_append (msg->response_headers,


Does it make sense to hard-code "en" here? This is the handler for all
documents that the GUPnPContext serves, right? These documents might as
well not be English, right? Perhaps there should be a property on
GUPnPContext that allows to change the language returned here. And that
property should probably default to "en" then.


Sven




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]