protected HttpRequest parseRequest(BufferedReader bufferedReader, String baseDir) {
        try {
            parseCommand(bufferedReader);
            ignoreHeaders(bufferedReader);
            return processRequest(bufferedReader, baseDir);
        } catch (IOException exception) {
            return new InvalidHttpRequest();
        }
    }