moved allowGzip to outer condition and set default header to empty-string

so that there's no need to handle null via StringUtil.isEmpty()