public void close() {
        synchronized (this) {
            if (isClosed) {
                return;
            }
        }

        try {
            deliverBody(null, true);
        }
        catch (HttpConnectionClosedException | IOException e) {
            Log.warn("Unexpected exception occurred while trying to close an HttpException.", e);
        }
    }
The connection should be closed without delivering a stanza to the requestor.
xmppserver/src/main/java/org/jivesoftware/openfire/http/HttpConnection.java