• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

maruina / go-infrabin / 18804481427
56%

Build:
DEFAULT BRANCH: master
Ran 25 Oct 2025 02:41PM UTC
Jobs 1
Files 14
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

25 Oct 2025 02:39PM UTC coverage: 51.009% (-3.7%) from 54.714%
18804481427

push

github

web-flow
Enhance HTTP request logging with proxy-aware source IP tracking (#404)

* Enhance HTTP request logging with proxy-aware source IP tracking

Replaces standard Apache Combined Log Format with an enhanced version that properly handles proxy headers (X-Real-IP, X-Forwarded-For) for accurate source IP logging.

## Changes

- Add `pkg/infrabin/logging.go` with custom log formatter
  - `RequestLoggingFormatter`: Extends Apache Combined Log Format
  - `getSourceIP`: Extracts client IP from proxy headers
- Update `pkg/infrabin/http.go` to use custom logging handler
  - Replace `CombinedLoggingHandler` with `CustomLoggingHandler`
  - Apply custom formatter for enhanced logging

## Log Format

sourceIP - remoteUser [timestamp] "method path protocol" statusCode size "referer" "userAgent"

## Benefits

- Accurate client IP logging behind proxies/load balancers
- Full Apache Combined format compatibility
- All request metadata preserved (size, user-agent, referer, protocol)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix errcheck linter: explicitly ignore fmt.Fprintf error

The LogFormatter signature doesn't allow error returns, and logging
failures shouldn't impact request handling. Following idiomatic Go
practice by explicitly acknowledging the ignored error with blank
identifiers.

---------

Co-authored-by: Claude <noreply@anthropic.com>

0 of 48 new or added lines in 2 files covered. (0.0%)

354 of 694 relevant lines covered (51.01%)

3.19 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
5
68.97
-3.32% pkg/infrabin/http.go
43
0.0
pkg/infrabin/logging.go
Jobs
ID Job ID Ran Files Coverage
1 18804481427.1 25 Oct 2025 02:41PM UTC 14
51.01
GitHub Action Run
Source Files on build 18804481427
  • Tree
  • List 14
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 79b3f077 on github
  • Prev Build on master (#18802780471)
  • Next Build on master (#18807559949)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc