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

use host instead of headers to make Rack happy #15741

Merged
merged 1 commit into from
Feb 16, 2021
Merged

Conversation

jtracey
Copy link
Contributor

@jtracey jtracey commented Feb 16, 2021

Hopefully fixes #15739.

It looks like headers is provided by Rails' extension to the request class, and doesn't appear in Rack's.

I'm going to submit a patch to Rails (hopefully in the next 24 hours) that uses host instead. I've already confirmed it works for that, I just need to get around to writing tests, then I'll file a PR for Rails and eventually try to upstream it to Rack as well. But I have not tested this patch for Mastodon, and the patches are slightly different.

@cohosh: Can you see if this works? I don't have a working masto instance right now.

"headers" is provided by Rails, Rack can't rely on it
@cohosh
Copy link
Contributor

cohosh commented Feb 16, 2021

Ah good catch. Yes the monkey patch does still work for onion services.

@Gargron Gargron merged commit 3f85231 into mastodon:main Feb 16, 2021
@jtracey jtracey deleted the patch-1 branch February 16, 2021 16:59
@jtracey
Copy link
Contributor Author

jtracey commented Feb 16, 2021

(I should also mention for posterity: this PR also likely fixed a minor bug where secure cookies wouldn't have been sent if the onion service was listening on a port other than 80.)

dr-bonez pushed a commit to Start9Labs/mastodon that referenced this pull request Mar 1, 2021
"headers" is provided by Rails, Rack can't rely on it
chrisguida pushed a commit to Start9Labs/mastodon that referenced this pull request Feb 26, 2022
"headers" is provided by Rails, Rack can't rely on it
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.

Sidekiq can't be displayed after #15725
3 participants