Skip to content

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

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 ...

}

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