perwendel / spark

A simple expressive web framework for java. Spark has a kotlin DSL https://github.com/perwendel/spark-kotlin
Apache License 2.0
9.64k stars 1.56k forks source link

#932. User gets 404 after exception handling #936

Open pelenthium opened 6 years ago

pelenthium commented 6 years ago

Sometimes we need to set only status code (as example for HTTP 204) without returning an empty string. it's surprise for beginners and me too:) that this code doesn't work as expected Spark.head("/api/resource/check", (req, res) -> { res.status(HttpStatus.NO_CONTENT_204); return null; });