Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create remote_port field #668

Closed
CleitonDeLima opened this issue Sep 17, 2024 · 3 comments · Fixed by #671
Closed

Create remote_port field #668

CleitonDeLima opened this issue Sep 17, 2024 · 3 comments · Fixed by #671

Comments

@CleitonDeLima
Copy link
Contributor

I wonder if it wouldn't be interesting to keep a record of the port in the logs, in some cases it might be useful to keep this information.

In the middleware it is ignored.

@hramezani
Copy link
Member

Yes, I think it would be useful sometimes to keep the port in remote_addr field.

As the library removes the port, we need a config to disable this behavior. the config shouldn't be enabled be default to prevent breaking changes.

@CleitonDeLima
Copy link
Contributor Author

CleitonDeLima commented Sep 23, 2024

Currently the IP value of the X-Forwarded-For header is taken. The port is removed in the middleware in a specific case. My idea is to create a new field remote_port (PositiveIntegerField) to save the port of the X-Forwarded-Port header that some servers configure.

This new field would only receive a value through a settings.

If it is a valid idea, I can make a PR.

@hramezani
Copy link
Member

My idea is to create a new field remote_port (PositiveIntegerField) to save the port of the X-Forwarded-Port header that some servers configure.

This also works. please remember to set the new field nullable to won't break the current system.

This new field would only receive a value through a settings.

Then we don't need the config. because adding a new nullable field won't break anything.

If it is a valid idea, I can make a PR.

Great!

@CleitonDeLima CleitonDeLima changed the title Why remove port from remote_addr field Create remote_port field Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants