mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 16:51:55 +00:00
fix: uses the same base64 for decoding we use for encoding the UsageCursor (#64290)
At the moment we decode via the "Std" encoding, which expects padding but we encode with "Raw" which doesn't add any. ## Test plan Manual testing
This commit is contained in:
parent
c09552ed15
commit
4ebb805bd3
@ -2,8 +2,6 @@ package resolvers
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"path"
|
||||
"strings"
|
||||
@ -343,13 +341,10 @@ func (args *UsagesForSymbolArgs) Resolve(
|
||||
}
|
||||
var cursor codenav.UsagesCursor
|
||||
if args.After != nil {
|
||||
bytes, err := base64.StdEncoding.DecodeString(*args.After)
|
||||
cursor, err = codenav.DecodeUsagesCursor(*args.After)
|
||||
if err != nil {
|
||||
return out, errors.Wrap(err, "invalid after: cursor")
|
||||
}
|
||||
if err = json.Unmarshal(bytes, &cursor); err != nil {
|
||||
return out, errors.Wrap(err, "invalid after: cursor")
|
||||
}
|
||||
} else {
|
||||
cursor.CursorType = codenav.CursorTypeDefinitions
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user