Skip to content

Fix Responses rule#215

Merged
PerthCharern merged 4 commits intomasterfrom
PerthCharern/RelaxResponsesRule
Feb 15, 2018
Merged

Fix Responses rule#215
PerthCharern merged 4 commits intomasterfrom
PerthCharern/RelaxResponsesRule

Conversation

@PerthCharern
Copy link
Contributor

@PerthCharern PerthCharern commented Feb 15, 2018

Fix #214, Fix #57

{
context.Enter(key);

if (key != "default" && !Regex.IsMatch(key, "^[1-5|X][0-9|X][0-9|X]$"))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The spec is kinda ambiguous here on whether XXX is allowed. I can see that the intention is probably "not allowed" - since "default" is created for that purpose. However, the exact wording of the spec itself does not make it crystal clear which digits the wildcard X can be used in.

To define a range of response codes, this field MAY contain the uppercase wildcard character X. For example, 2XX represents all response codes between [200-299]. The following range definitions are allowed: 1XX, 2XX, 3XX, 4XX, and 5XX. If a response range is defined using an explicit code, the explicit code definition takes precedence over the range definition for that code.

Copy link
Member

Choose a reason for hiding this comment

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

I submitted a PR to the spec to clarify the wording. Does this help?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup. That helps. I'll fix my code

@PerthCharern PerthCharern merged commit 9eb2d08 into master Feb 15, 2018
@PerthCharern PerthCharern deleted the PerthCharern/RelaxResponsesRule branch September 26, 2018 22:40
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