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.63k stars 1.56k forks source link

Why should we always have Content-Type been set ? #1276

Open towerhe opened 1 year ago

towerhe commented 1 year ago

The codes I found in Body.java

if (httpResponse.getContentType() == null) {
    httpResponse.setContentType("text/html; charset=utf-8");
}

If the body is set to null, I think Content-Type should not be set.

aohanhongzhi commented 1 year ago

why ?