private String headerRep(final String pLength, final String pCode) {

    Date date = new Date();
    String mimetostring;


    if (!pCode.substring(0, 1).equals("4")
            && !pCode.substring(0, 1).equals("5")) { // si erreur

        mimetostring = Mime.extractTypeMime(hostpath + headerQuest.getCible());
    } else {
        mimetostring = "text/html";
    }

    this.headersRep.put("Date", date);
            if (Http.getConfig().getParam("Serveur") != null) {
    this.headersRep.put("Server", Http.getConfig().getParam("Serveur"));
    } else {
    this.headersRep.put("Server", "CNAM_NFE103/1.0");
    }
    this.headersRep.put("Content-Type", mimetostring); // Mime type
    this.headersRep.put("Content-Length", pLength); // length of chain
    if (Http.getConfig().getParam("Connection") != null) {
    this.headersRep.put("Connection", Http.getConfig().getParam("Connection"));
    } else {
    this.headersRep.put("Connection", "close"); // length of chain
    }
    String line = this.PROTOCOL + " " + pCode + CRLF; // RECUP PROTOCOLE
    String key;

    final Enumeration<String> e;
    e = Collections.enumeration(headersRep.keySet());

    while (e.hasMoreElements()) {
        key = e.nextElement();
        line += key + ":" + this.headersRep.get(key) + CRLF;
    }
    line += CRLF;
    return line;

    }