Skip to content

Restrictinf xml file size #10

Description

@girisubhra

I want to read the xml file whose size is above 600 bytes. so i modifed code as below, but it is not giving expected result. can you please suggest on this.
File name : datasource.go

func (d *Datasource) ReadAll(ctx context.Context) ([]byte, error) {
var reader io.Reader
rc, err := d.GetStream(ctx)
if err != nil {
return nil, err
}
defer rc.Close()
reader = io.LimitReader(rc, *d.MaxContentLength)
if reader > 600 {
return ioutil.ReadAll(reader)
}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions