[PATCH] Rename referrer to referer in error log

Jeremie Drouet jeremie.drouet at gmail.com
Thu Jul 8 09:17:00 UTC 2021


# HG changeset patch
# User Jeremie Drouet <jeremie.drouet at gmail.com>
# Date 1625150632 -7200
#      Thu Jul 01 16:43:52 2021 +0200
# Node ID 7db380334d2ca671b98ab7563bab9ddee501c573
# Parent  e0fdd75871e40e4c57ed405cadb94235550142c9
Rename referrer to referer in error log

According to the developer doc from mozilla, referrer should be
written with only one R and everywhere in the nginx codebase, we
are using referer with only one R, so to make it consistent, I
propose you to replace referrer with two R in the error log
message with referer with only one R.
I'm also proposing this because of the work I'm doing on vector
regarding a nginx log parser in which we end up having referer
and referrer when we parse logs.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer
https://github.com/timberio/vector/

diff -r e0fdd75871e4 -r 7db380334d2c src/http/ngx_http_request.c
--- a/src/http/ngx_http_request.c	Mon Jun 28 18:01:24 2021 +0300
+++ b/src/http/ngx_http_request.c	Thu Jul 01 16:43:52 2021 +0200
@@ -3889,7 +3889,7 @@
     }
 
     if (r->headers_in.referer) {
-        p = ngx_snprintf(buf, len, ", referrer: \"%V\"",
+        p = ngx_snprintf(buf, len, ", referer: \"%V\"",
                          &r->headers_in.referer->value);
         buf = p;
     }



More information about the nginx-devel mailing list