Skip to content

Paging on the same request #174

@tormath1

Description

@tormath1

Hi,

I'm using the same request to perform a search with paging and the other without paging:

request := &ldap.SearchRequest{}
request.Scope = ldap.ScopeWholeSubtree
...
// First search, with paging
client.SearchWithPaging(request, 100)
...
// Second search, without paging but with a modified `filter`
client.Search(request)

My second request failed because request.Controls is not nil thanks to the method SearchWithPaging which appends ControlPaging to the request.

So I need to "reset" it manually:

...
request.Controls = []ldap.Controls{}
// Second search, without paging but with a modified `filter`
client.Search(request)

Thanks for your lib guys ! 😸

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions