File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -515,6 +515,17 @@ echo "Testing no logging of url params option works..."
515515docker logs " ${MOCKSERVER} " | grep ' Nginxid:'
516516docker logs ${INSTANCE} | grep ' "nginx_uuid": "'
517517
518+ start_test " Test UUID header logging option passes through supplied value..." " ${STD_CMD} \
519+ -e \" PROXY_SERVICE_HOST=http://${MOCKSERVER} \" \
520+ -e \" PROXY_SERVICE_PORT=${MOCKSERVER_PORT} \" \
521+ -e \" DNSMASK=TRUE\" \
522+ -e \" ENABLE_UUID_PARAM=HEADER\" \
523+ --link \" ${MOCKSERVER} :${MOCKSERVER} \" "
524+ curl -sk -H " nginxId: 00000000-1111-2222-3333-444455556666" https://${DOCKER_HOST_NAME} :${PORT}
525+ echo " Testing no logging of url params option works..."
526+ docker logs " ${MOCKSERVER} " | grep ' Nginxid:00000000-1111-2222-3333-444455556666'
527+ docker logs ${INSTANCE} | grep ' "nginx_uuid": "00000000-1111-2222-3333-444455556666"'
528+
518529start_test " Test VERBOSE_ERROR_PAGES=TRUE displays debug info" " ${STD_CMD} \
519530 -e \" PROXY_SERVICE_HOST=http://${MOCKSERVER} \" \
520531 -e \" PROXY_SERVICE_PORT=${MOCKSERVER_PORT} \" \
Original file line number Diff line number Diff line change 11if os.getenv (" LOG_UUID" ) == " FALSE" then
22 return " "
33else
4- local socket = require (" socket" )
5- local uuid = require (" uuid" )
6- uuid .randomseed (socket .gettime ()* 10000 )
7- local uuid_str = uuid ()
4+ local uuid_str = " "
5+ if ngx .req .get_headers ()[" nginxId" ] == nil then
6+ local socket = require (" socket" )
7+ local uuid = require (" uuid" )
8+ uuid .randomseed (socket .gettime ()* 10000 )
9+ uuid_str = uuid ()
10+ else
11+ uuid_str = ngx .req .get_headers ()[" nginxId" ]
12+ end
813 ngx .var .uuid = uuid_str
914 ngx .var .uuid_log_opt = " nginxId=" .. uuid_str
1015 return uuid_str
11- end
16+ end
You can’t perform that action at this time.
0 commit comments