Open comepasto opened 6 years ago
You could modify the response in the after filter ?
Yes, sure. At the end it is the same, I have to return an empty string. And it seems the only issue.
The thing is, the behavior has changed completely.
The error message says 404, the route has not been mapped in Spark
. However, the route is correctly mapped and executed correctly.
Some applications are full rest applications. They do not serve any page. And they do not need to return a body.
I would like to propose a fix, but as I read on the Sparkjava page, 2.7.x is probably the last release before the 3.0.0. And I do not see any branch for that. (I hope it is not the end, sniff)
I experience similar issue. I mapped:
post("/abc", ...);
put("/abc", ...);
get("/abc", ...);
POST and GET works fine, but PUT returns 404. However the execution is done correctly, I can see the modified data again via GET.
In logs:
... The requested route [/abc] has not been mapped in Spark for Accept: [*/*]
Hello, I want to try to solve this problem
Issue #909 introduced a side effect. In my case, some APIs do not need to return a body. An http status 200 is enough. To cope with that, I set the flag externalContainer to true. My routes just return
null
in that case. Then I just decided to upgrade to 2.7.0. Bad idea! All those APIs return a 404 even if they have executed correctly. Logs say :The requested route [{}] has not been mapped in Spark for {}
.Is there a different way to ignore a
null
body other than returning an empty string?Thank you.