Skip to content

Commit

Permalink
regress: hide REMOTE_{ADDR,HOST} too
Browse files Browse the repository at this point in the history
  • Loading branch information
omar-polo committed Aug 24, 2024
1 parent b8bce50 commit 8538b54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 3 additions & 1 deletion regress/fcgi-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ parse_params(int sock, struct param *param, struct fcgi_header *hdr)
must_read(sock, param->name, nlen);
must_read(sock, param->value, vlen);

if (!strcmp(param->name, "SERVER_NAME"))
if (!strcmp(param->name, "SERVER_NAME") ||
!strcmp(param->name, "REMOTE_ADDR") ||
!strcmp(param->name, "REMOTE_HOST"))
strlcpy(param->value, "<redacted>", sizeof(param->value));

consume(sock, hdr->padding);
Expand Down
9 changes: 2 additions & 7 deletions regress/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ server_name=
gghost=

fcgi_content() {
remote_host=::1
if [ "$HAVE_IPV6" != yes ]; then
remote_host=127.0.0.1
fi

cat <<EOF
Here's the parameters I've got:
* AUTH_TYPE=
Expand All @@ -23,8 +18,8 @@ Here's the parameters I've got:
* PATH_INFO=$fcgi_path_info
* PATH_TRANSLATED=$fcgi_path
* QUERY_STRING=
* REMOTE_ADDR=$remote_host
* REMOTE_HOST=$remote_host
* REMOTE_ADDR=<redacted>
* REMOTE_HOST=<redacted>
* REQUEST_METHOD=GET
* SCRIPT_NAME=
* SERVER_NAME=<redacted>
Expand Down

0 comments on commit 8538b54

Please sign in to comment.