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

Expose api/status with HTTP + fix functional tests #4338

Merged
merged 2 commits into from
Jul 6, 2017
Merged

Expose api/status with HTTP + fix functional tests #4338

merged 2 commits into from
Jul 6, 2017

Conversation

skofman1
Copy link
Contributor

@skofman1 skofman1 commented Jul 6, 2017

Fixes: #4336

Noticed HttpToHttps functional tests don't run during deployment, so fixed it.

@@ -106,7 +106,8 @@ public static void Configuration(IAppBuilder app)
}
else
{
app.UseForceSsl(config.Current.SSLPort, new[] { config.Current.ForceSslExclusion });
var paths = config.Current.ForceSslExclusion.Split(';');
Copy link
Member

Choose a reason for hiding this comment

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

Today, this code does not add an empty string or whitespace exclusion. This is now possible with a config value of ;;;; or something like that. We should filter out empty or whitespace before passing paths into UseForceSsl.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a configuration property that should only be used by people that know what they are doing (or even better, should never be changed). Given this, I don't think we should do excessive correctness checks on the input. If we start with ;;; we can also check the path has a valid format, etc. All are unnecessary.

/// A string containing a path exluded from
/// forcing the HTTP to HTTPS redirection.
/// A string containing a path exluded from forcing the HTTP to HTTPS redirection.
/// To provide multiple paths separate them with ;
/// </summary>
[DefaultValue("")]
public string ForceSslExclusion { get; set; }
Copy link
Member

Choose a reason for hiding this comment

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

Can this type be a IEnumerable<string>? It looks like we have some other complex types below like MailAddress enabled by a TypeConverter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I checked this option, and we currently don't support arrays as part of configuration, and using TypeConverter for this will introduce unnecessary complexity.

Copy link
Member

Choose a reason for hiding this comment

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

Any consumer of IAppConfiguration therefore has to perform the semicolon splitting and filtering out of useless whitespaces. The semicolon thing is essentially a workaround due to the fact that we can't express enumeration in our current config format. The runtime interaction with the config values should be as simple as possible.

(take the example of MailAddress, which is not just a simple string)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Member

@joelverhagen joelverhagen left a comment

Choose a reason for hiding this comment

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

⌚️

Copy link
Member

@joelverhagen joelverhagen left a comment

Choose a reason for hiding this comment

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

👏

@skofman1 skofman1 merged commit d42cd2e into dev Jul 6, 2017
@xavierdecoster xavierdecoster deleted the bug4336 branch July 7, 2017 08:20
@skofman1 skofman1 mentioned this pull request Jul 7, 2017
4 tasks
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.

6 participants