when call middle.Exception should set w.WriteHeader first