-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Labels
P2Medium: Good to have, but can wait until someone steps upMedium: Good to have, but can wait until someone steps updif/easySomeone with a little familiarity can pick upSomeone with a little familiarity can pick upeffort/hoursEstimated to take one or several hoursEstimated to take one or several hoursgood first issueGood issue for new contributorsGood issue for new contributorshelp wantedSeeking public contribution on this issueSeeking public contribution on this issuekind/bugA bug in existing code (including security flaws)A bug in existing code (including security flaws)status/readyReady to be workedReady to be worked
Description
What's the problem
Delegated routing client is too rigid with its expectation of Content-Type
header value. In this line:
https://github.com/ipfs/helia-delegated-routing-v1-http-api/blob/main/packages/client/src/client.ts#L142
If the value is not "application/json"
, then it will return an empty array for getProviders
, with no error logs or anything. Even if the status was 200.
We have a routing server that returns Content-Type="application/json; charset=utf-8"
, and clients are not able to consume its providers JSON.
Reproduction
const client = createDelegatedRoutingV1HttpApiClient("https://peers.pleb.bot");
const generator = client.getProviders(CID.parse("QmdjSj3KGquq2hucok1F7fNRmvi9DhZidh9NsRpdk3Q553"), {
filterAddrs: undefined,
filterProtocols: undefined,
});
const firstValue = await generator.next(); // undefined, even though the routing server responds with at least one provider
// No errors at all as well
Metadata
Metadata
Assignees
Labels
P2Medium: Good to have, but can wait until someone steps upMedium: Good to have, but can wait until someone steps updif/easySomeone with a little familiarity can pick upSomeone with a little familiarity can pick upeffort/hoursEstimated to take one or several hoursEstimated to take one or several hoursgood first issueGood issue for new contributorsGood issue for new contributorshelp wantedSeeking public contribution on this issueSeeking public contribution on this issuekind/bugA bug in existing code (including security flaws)A bug in existing code (including security flaws)status/readyReady to be workedReady to be worked