Skip to content

fix(public-api-gateway): correct audit IP extraction from forwarded headers - #1353

Open
AleksaMCode wants to merge 1 commit into
semaphoreio:mainfrom
AleksaMCode:fix/audit-ip-extraction
Open

AleksaMCode wants to merge 1 commit into
semaphoreio:mainfrom
AleksaMCode:fix/audit-ip-extraction

Conversation

@AleksaMCode

Copy link
Copy Markdown

📝 Description

This PR fixes audit IP extraction in public-api-gateway middleware to align with standard proxy header semantics and behavior used in other services.

✅ Checklist

  • I have tested this change
  • This change requires documentation update

if xff := r.Header.Get("X-Forwarded-For"); xff != "" {
// X-Forwarded-For can contain multiple IPs, the second from the end is the original client
if xff := strings.TrimSpace(r.Header.Get("X-Forwarded-For")); xff != "" {
// X-Forwarded-For can contain multiple IPs; the original client is the first entry.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant