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

Multi-address client: move setHostHeader to key factory, avoid NPE warn #2976

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

idelpivnitskiy
Copy link
Member

Motivation:

setHostHeader method is too far from where it's used and IDE warns that authority might be null.

Modifications:

  • Move setHostHeader to CachingKeyFactory;
  • Pass host and port as arguments from the context where it's known that the host is non-null;
  • Use compareTo for HTTP version check;

Motivation:

`setHostHeader` method is too far from where it's used and IDE warns
that `authority` might be `null`.

Modifications:

- Move `setHostHeader` to `CachingKeyFactory`;
- Pass host and port as arguments from the context where it's known that
the `host` is non-null;
- Use `compareTo` for HTTP version check;
@idelpivnitskiy idelpivnitskiy self-assigned this Jun 17, 2024
@idelpivnitskiy idelpivnitskiy merged commit e110d64 into apple:main Jun 17, 2024
11 checks passed
@idelpivnitskiy idelpivnitskiy deleted the setHostHeader branch June 17, 2024 23:23
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