trafficcontrol
trafficcontrol copied to clipboard
profileparameters POST request with no request body returns Internal Server Error
I'm submitting a ...
- [X] bug report
- [ ] new feature / enhancement request
- [ ] improvement request (usability, performance, tech debt, etc.)
- [ ] other
Traffic Control components affected ...
- [ ] CDN in a Box
- [ ] Documentation
- [ ] Grove
- [ ] Traffic Control Client
- [ ] Traffic Monitor
- [X] Traffic Ops
- [ ] Traffic Ops ORT
- [ ] Traffic Portal
- [ ] Traffic Router
- [ ] Traffic Stats
- [ ] Traffic Vault
- [ ] unknown
Current behavior:
Making a POST
request to /profileparameters
with no body in the request returns:
HTTP/1.1 500 Internal Server Error
{
"alerts": [
{
"text": "Internal Server Error",
"level": "error"
}
]
}
Expected / new behavior:
Most endpoints return:
HTTP/1.1 400 Bad Request
{
"alerts": [
{
"text": "EOF",
"level": "error"
}
]
}
Minimal reproduction of the problem with instructions:
Anything else:
Is that a regression, or did Perl panic too?
Perl returned:
HTTP/1.1 400 Bad Request
{
"alerts": [
{
"level": "error",
"text": "parameters must be in JSON format."
}
]
}
This is also caused syntactically invalid bodies e.g. [
, {
, and any valid JSON that isn't an object or array e.g. "string"
, null