Skip to content

Conversation

@CrazyCraftix
Copy link

@CrazyCraftix CrazyCraftix commented Oct 13, 2025

It resolves #569

Description

So far, the HTTP host header has been used to determine the hostname that is being accessed. In HTTP/2, this header is not guaranteed to be sent. Instead, the ":authority" pseudo-header field is used. I added a check for that header to make virtual hosts also work with HTTP/2.

Also I found out that the HTTP host header may also contain the port number, so I added a check to remove it if it's there.

How Has This Been Tested?

Not thoroughly, just manually for my usecase, so there may still be problems I didn't consider.
I suppose an automated test would be nice but I'm not sure what's the best way to do this.

@semanticdiff-com
Copy link

semanticdiff-com bot commented Oct 13, 2025

Review changes with  SemanticDiff

@joseluisq joseluisq added v2 v2 release bugfix This is PR fixes a bug labels Oct 18, 2025
Copy link
Collaborator

@joseluisq joseluisq left a comment

Choose a reason for hiding this comment

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

I will add some test cases.

@joseluisq
Copy link
Collaborator

@CrazyCraftix I made the mistake of force-pushing accidentally when wanting to add tests.
I created a new PR #571 with your changes and added tests.
I apologize.

@joseluisq joseluisq added this to the v2.38.2 milestone Oct 18, 2025
@CrazyCraftix
Copy link
Author

All good, thanks for integrating it!

@joseluisq joseluisq modified the milestones: v2.38.2, v2.39.0 Oct 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix This is PR fixes a bug v2 v2 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Virtual Hosts don't work with HTTP/2

2 participants