Skip to content

BC: Add server params (REMOTE_ADDR) to PSR request - #3

Merged
dominikzogg merged 1 commit into
chubbyphp:masterfrom
bohanwood:remote-addr
Jul 4, 2022
Merged

BC: Add server params (REMOTE_ADDR) to PSR request#3
dominikzogg merged 1 commit into
chubbyphp:masterfrom
bohanwood:remote-addr

Conversation

@bohanwood

Copy link
Copy Markdown
Contributor

Because we need the client IP.
Even if X-Forwarded-For or X-Real-IP header can be used,
it's important to use the REMOTE_ADDR to determine whether
the request comes from a trusted edge server/proxy.

Comment thread src/PsrRequestFactoryInterface.php Outdated
@dominikzogg

Copy link
Copy Markdown
Member

Hello @bohanyang

Thank you for your PR.

Have you checked if there is no way getting this information from the workerman request itself?
I ask, cause this is a BC, means merging an release this change will mean to release a new major version.

Regards Dominik

@bohanwood

Copy link
Copy Markdown
Contributor Author

@dominikzogg

Yeah, it has to cause a BC break since the WorkermanRequest contains no information beyond HTTP header lines and body.

I've updated the parameter order according to your suggestion.

@dominikzogg

Copy link
Copy Markdown
Member

@bohanwood

Copy link
Copy Markdown
Contributor Author

Version updated

@dominikzogg

Copy link
Copy Markdown
Member

@bohanyang sorry, i should have been more precise, version needs to be 2.0

Comment thread src/OnMessage.php Outdated
@bohanwood

Copy link
Copy Markdown
Contributor Author

Oh sorry it's a major version update, my fault.
Updated

@bohanwood bohanwood changed the title Create PSR request with server params (REMOTE_ADDR) BC: Add server params (REMOTE_ADDR) to PSR request Jul 4, 2022
@dominikzogg

Copy link
Copy Markdown
Member

@bohanyang it seems that the CI doesn't get started on the CI, have you run the tests locally? I guess the OnMessageTest should fail.

@bohanwood

Copy link
Copy Markdown
Contributor Author

Tests will pass now.

@dominikzogg
dominikzogg merged commit 1a19d31 into chubbyphp:master Jul 4, 2022
@dominikzogg

Copy link
Copy Markdown
Member

@bohanyang thanks for your contribution

@dominikzogg

Copy link
Copy Markdown
Member

@bohanwood
bohanwood deleted the remote-addr branch November 4, 2022 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants