Skip to content

Commit

Permalink
chore: don't log redundant error message (#71)
Browse files Browse the repository at this point in the history
* chore: don't log redundant error message

* chore: update e2e tests
  • Loading branch information
danroc authored Dec 8, 2024
1 parent acc02b3 commit 9c5d8aa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build-test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ jobs:
- name: Run tests
run: make test

- name: Build e2e tests image
run: docker build -f tests/Dockerfile -t geoblock-tests .

- name: Run e2e tests
run: docker run geoblock-tests

- name: Require clean working directory
shell: bash
run: |
if ! git diff --exit-code; then
echo "Working tree dirty at end of job"
exit 1
fi
- name: Build e2e tests image
run: docker build -f tests/Dockerfile -t geoblock-tests .

- name: Run e2e tests
run: docker run geoblock-tests
2 changes: 1 addition & 1 deletion internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func getForwardAuth(
FieldRequestDomain: domain,
FieldRequestMethod: method,
FieldSourceIP: origin,
}).WithError(err).Error("Invalid source IP")
}).Error("Invalid source IP")
writer.WriteHeader(http.StatusBadRequest)
metrics.Invalid.Add(1)
return
Expand Down
2 changes: 1 addition & 1 deletion tests/expected.log
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ time="2024-12-08T08:54:07Z" level=info msg="Loading configuration file"
time="2024-12-08T08:54:07Z" level=info msg="Initializing database resolver"
time="2024-12-08T08:54:09Z" level=info msg="Starting server at :8080"
time="2024-12-08T08:54:09Z" level=error msg="Missing required headers" request_domain= request_method=GET source_ip=127.0.0.1
time="2024-12-08T08:54:10Z" level=error msg="Invalid source IP" error="ParseAddr(\"invalid-ip\"): unable to parse IP" request_domain=example.org request_method=GET source_ip=invalid-ip
time="2024-12-08T08:54:10Z" level=error msg="Invalid source IP" request_domain=example.org request_method=GET source_ip=invalid-ip
time="2024-12-08T08:54:10Z" level=error msg="Missing required headers" request_domain=example.com request_method=GET source_ip=
time="2024-12-08T08:54:10Z" level=error msg="Missing required headers" request_domain=example.com request_method= source_ip=8.8.8.8
time="2024-12-08T08:54:10Z" level=warning msg="Request denied" request_domain=example.org request_method=GET source_asn=15169 source_country=US source_ip=8.8.8.8 source_org=GOOGLE
Expand Down

0 comments on commit 9c5d8aa

Please sign in to comment.