From cf610dcd94b742b2d6f3cb9397ebc3f4f09bca00 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 17 Jun 2021 07:25:43 +0000 Subject: [PATCH] Explicitly set a content type header. --- ngx_http_js_challenge.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ngx_http_js_challenge.c b/ngx_http_js_challenge.c index ac93c80..e87e911 100644 --- a/ngx_http_js_challenge.c +++ b/ngx_http_js_challenge.c @@ -214,6 +214,7 @@ int serve_challenge(ngx_http_request_t *r, const char *challenge, const char *ht *(title_c_str + title.len) = '\0'; unsigned char buf[32768]; + static const ngx_str_t content_type = ngx_string("text/html;charset=utf-8"); if (html == NULL) { html = "

Set the js_challenge_html /path/to/body.html; directive to change this page.

"; @@ -232,6 +233,7 @@ int serve_challenge(ngx_http_request_t *r, const char *challenge, const char *ht r->headers_out.status = NGX_HTTP_OK; r->headers_out.content_length_n = size; + r->headers_out.content_type = content_type; ngx_http_send_header(r); ngx_http_output_filter(r, &out);