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

redirect: determine the FromScheme at runtime (#1297) #1365

Merged
merged 1 commit into from
Feb 16, 2017

Conversation

tw4452852
Copy link
Collaborator

@tw4452852 tw4452852 commented Jan 21, 2017

cfg.TLS.Enabled may be changed after plugin setup (here), but redirect plugin doesn't catch it.

Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

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

Thanks for working on this Tw!

if cfg.TLS.Enabled {
return "https"
}
return "http"
Copy link
Member

Choose a reason for hiding this comment

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

Is this thread-safe?

(If not, and if the solution is to introduce locking, let's reconsider how we do the scheme changing instead...)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

cfg.TLS.Enabled is setup at the server's initialization. Unless we changed it on the fly later, it is thread-safe IMO.

Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

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

Thanks for fixing the issue! If a race does crop up because of this, I hope you'll be able to help us fix it. I'll merge this now.

@mholt mholt merged commit 1183d91 into caddyserver:master Feb 16, 2017
@tw4452852 tw4452852 deleted the 1297 branch February 16, 2017 04:27
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