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

User can create routing regular expression without pattern param input #4981

Closed
dpham692 opened this issue Aug 20, 2020 · 2 comments · Fixed by #5017
Closed

User can create routing regular expression without pattern param input #4981

dpham692 opened this issue Aug 20, 2020 · 2 comments · Fixed by #5017
Labels
regression bug a bug in existing functionality introduced by a new version Traffic Ops related to Traffic Ops

Comments

@dpham692
Copy link
Contributor

I'm submitting a ...

  • bug report

Traffic Control components affected ...

  • Traffic Ops

Current behavior:

The POST handler of the deliveryservices/{{ID}}/regexes endpoint let user create routing regular expression for a Delivery Service when the request payload have a blank pattern.

Expected / new behavior:

It should not let user create regexes and return 400 Bad Request with response message like

{
    "alerts": [
        {
            "text": "malformed JSON",
            "level": "error"
        }
    ]
}

Minimal reproduction of the problem with instructions:

Do a POST https://{{TO_BASE_URL}}/api/3.0/deliveryservices/1/regexes with this payload:

{
    "pattern": "",
    "type": 33,
    "setNumber": 20
}

Pattern input is empty and user can still create a regrexes.

Anything else:

@mitchell852 mitchell852 added the Traffic Ops related to Traffic Ops label Aug 21, 2020
@mitchell852
Copy link
Member

@dpham692 - just curious. can you do a blank pattern in TP?

@mitchell852 mitchell852 added the regression bug a bug in existing functionality introduced by a new version label Aug 21, 2020
@rimashah25
Copy link
Contributor

@mitchell852: No, TP has it as a required field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression bug a bug in existing functionality introduced by a new version Traffic Ops related to Traffic Ops
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants