Skip to content

Impose read limit for large content/screenshot etc. #28

@shicky

Description

@shicky

It would be nice to have an option to set read limit for large file size.

func (wd *remoteWebDriver) execute(method, url string, data []byte) ([]byte, error) {

    // omitted ...

    buf, err := ioutil.ReadAll(res.Body)
    if err != nil {
        return nil, err
    }

    // omitted ...

}

to

func (wd *remoteWebDriver) execute(method, url string, data []byte) ([]byte, error) {

    // omitted ...

    limit := 1 << 20 // 1MB limit
    buf, err := ioutil.ReadAll( io.LimitReader(r.Body, limit) )
    if err != nil {
        return nil, err
    }

    // omitted ...

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions