perwendel / spark

A simple expressive web framework for java. Spark has a kotlin DSL https://github.com/perwendel/spark-kotlin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why should we always have Content-Type been set ?

towerhe opened this issue · comments

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.

why ?