Skip to content

Large attachments bypassing isAttachment in AttachmentHandler? #262

Description

@skyhirider

I experienced a use case I am still investigating where an attachment that is large (over the HtmlUnit in memory limit) and gets saved in the temp folder bypasses the attachment handler all together.

The test I created always prints the response header when the isAttachment method is called.

default boolean isAttachment(final WebResponse response) {

This header is never printed when a large files is processed, and a htmlunit temp file is created instead which is then processed by handleAttachment.

This behavior seems odd. I would expect isAttachment to always trigger and even this process to follow the standard attachment flow.

public boolean isAttachment(final WebResponse response) {
        System.out.println(response.getResponseHeaders());
    return AttachmentHandler.super.isAttachment(response);
}

Edit: nevermind, isAttachment was triggered correctly but was delayed and only appeared after the whole stream has finished downloading. Which is interesting as it should be possible to determine if the start of the stream is an attachment before finishing the whole download.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions