From: Jaroslav Kysela Date: Mon, 14 Jan 2019 11:28:51 +0000 (+0100) Subject: http: CORS - small optimization X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f44e2e58ef360e7fb9f8ab7aacf042e0de725af3;p=thirdparty%2Ftvheadend.git http: CORS - small optimization --- diff --git a/src/http.c b/src/http.c index 72070c52f..c3355110e 100644 --- a/src/http.c +++ b/src/http.c @@ -331,10 +331,10 @@ http_send_header(http_connection_t *hc, int rc, const char *content, if (hc->hc_version != RTSP_VERSION_1_0){ htsbuf_qprintf(&hdrs, "Server: %s\r\n", config_get_http_server_name()); if (config.cors_origin && config.cors_origin[0]) { - htsbuf_qprintf(&hdrs, "Access-Control-Allow-Origin: %s\r\n", config.cors_origin); - htsbuf_append_str(&hdrs, "Access-Control-Allow-Methods: POST, GET, OPTIONS\r\n"); - htsbuf_append_str(&hdrs, "Access-Control-Allow-Headers: x-requested-with,authorization\r\n"); - htsbuf_append_str(&hdrs, "Access-Control-Allow-Credentials: true\r\n"); + htsbuf_qprintf(&hdrs, "Access-Control-Allow-Origin: %s\r\n%s%s%s", config.cors_origin, + "Access-Control-Allow-Methods: POST, GET, OPTIONS\r\n", + "Access-Control-Allow-Headers: x-requested-with,authorization\r\n", + "Access-Control-Allow-Credentials: true\r\n"); } }