Skip to content
This repository was archived by the owner on Apr 29, 2026. It is now read-only.

Fix multiple ip issues on proxy servers#1

Merged
eldadfux merged 3 commits intoutopia-php:masterfrom
lohanidamodar:fix-multiple-ips-on-proxy
Feb 10, 2021
Merged

Fix multiple ip issues on proxy servers#1
eldadfux merged 3 commits intoutopia-php:masterfrom
lohanidamodar:fix-multiple-ips-on-proxy

Conversation

@lohanidamodar
Copy link
Copy Markdown
Contributor

On a proxy server the header returns comma separated multiple IPs, where the first one is always the user's original IP.

@eldadfux
Copy link
Copy Markdown
Member

eldadfux commented Feb 9, 2021

Does that even make sense? Why do they return multiple IPs? Which proxy server did that?

Copy link
Copy Markdown
Contributor

@TorstenDittmann TorstenDittmann left a comment

Choose a reason for hiding this comment

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

I would trim() the to be returned value.

From what I have read, there can be spaces 👍🏻

@TorstenDittmann
Copy link
Copy Markdown
Contributor

Does that even make sense? Why do they return multiple IPs? Which proxy server did that?

https://serverfault.com/a/997805

@lohanidamodar
Copy link
Copy Markdown
Contributor Author

Does that even make sense? Why do they return multiple IPs? Which proxy server did that?

I talked briefly in meeting, In Digitalocean Apps Platform, you can check it https://appwrite-lite-t22pl.ondigitalocean.app/

@eldadfux
Copy link
Copy Markdown
Member

eldadfux commented Feb 9, 2021

@lohanidamodar I would also split the statement to two part and validate the [0] key is actually their (just to be on the safe side) using isset or ?? operator. The fallback an be an empty string.

@eldadfux
Copy link
Copy Markdown
Member

eldadfux commented Feb 9, 2021

@lohanidamodar we should probably later add the same fix to utopia/framework request object

@lohanidamodar
Copy link
Copy Markdown
Contributor Author

@lohanidamodar I would also split the statement to two part and validate the [0] key is actually their (just to be on the safe side) using isset or ?? operator. The fallback an be an empty string.

done

@lohanidamodar
Copy link
Copy Markdown
Contributor Author

@lohanidamodar we should probably later add the same fix to utopia/framework request object

Will look into it

@eldadfux
Copy link
Copy Markdown
Member

eldadfux commented Feb 9, 2021

@lohanidamodar looks good, waiting for the tests to pass 👌🏻

@eldadfux eldadfux merged commit 63168a8 into utopia-php:master Feb 10, 2021
This was referenced Aug 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants