algorand / go-algorand-sdk

Algorand Golang SDK

Home Page:https://pkg.go.dev/github.com/algorand/go-algorand-sdk/v2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Calling `getRequestUrl()` result in the HTTP request to fail with `Missing Authentication Token`

matyasberry opened this issue · comments

Subject of the issue

Calling getRequestUrl() result in the HTTP request to fail with Missing Authentication Token

Your environment

Manjaro Linux 5.17,
JDK 17,
Algo SDK 1.13

Steps to reproduce

var query = indexer
.lookupAccountTransactions(senderAddress)
.assetId(assetId)
.notePrefix(note.getBytes(StandardCharsets.UTF_8))
.limit(2L);
System.out.println("query = " + query.getRequestUrl());
query.execute();

Expected behaviour

Successful call, just like as if I did:

var result = indexer
.lookupAccountTransactions(senderAddress)
.assetId(assetId)
.notePrefix(note.getBytes(StandardCharsets.UTF_8))
.limit(2L).execute();

Actual behaviour

HTTP 403

The problem seems to be that calling getRequestUrl() results in multiple calls to LookupAccountTransactions.getRequestString() which keeps adding to the path segments resulting in a wrong url.