Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix Host header sent by MatrixFederationAgent #4468

Merged
merged 2 commits into from
Jan 25, 2019
Merged

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Jan 25, 2019

Move the Host header logic down here so that (a) it is used if we reuse the
agent elsewhere, and (b) we can mess about with it with .well-known.

Move the Host header logic down here so that (a) it is used if we reuse the
agent elsewhere, and (b) we can mess about with it with .well-known.
@richvdh richvdh requested a review from a team January 25, 2019 09:50
Copy link
Member

@erikjohnston erikjohnston left a comment

Choose a reason for hiding this comment

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

LGTM modulo needing a newsfile

headers = headers.copy()

if not headers.hasHeader(b'host'):
headers.addRawHeader(b'host', server_name_bytes)
Copy link
Member

Choose a reason for hiding this comment

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

I'm assuming header names are case insensitive here?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, twisted sorts that out for us.

@codecov-io
Copy link

codecov-io commented Jan 25, 2019

Codecov Report

Merging #4468 into develop will decrease coverage by 0.01%.
The diff coverage is 83.33%.

@@             Coverage Diff             @@
##           develop    #4468      +/-   ##
===========================================
- Coverage    74.77%   74.75%   -0.02%     
===========================================
  Files          336      336              
  Lines        34023    34062      +39     
  Branches      5533     5540       +7     
===========================================
+ Hits         25439    25462      +23     
- Misses        7014     7026      +12     
- Partials      1570     1574       +4

@richvdh
Copy link
Member Author

richvdh commented Jan 25, 2019

LGTM modulo needing a newsfile

I made it and failed to commit it :/

@richvdh richvdh merged commit 8520bc3 into develop Jan 25, 2019
@richvdh richvdh deleted the rav/host_header branch December 1, 2020 12:40
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