Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
chore: apply feedback suggestions
Browse files Browse the repository at this point in the history
Co-authored-by: Marcin Rataj <[email protected]>
  • Loading branch information
hacdias and lidel authored Aug 10, 2023
1 parent af8a46e commit 9a8e9d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions docs/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,19 @@ in the near feature.
### `PROXY_GATEWAY_URL`

Single URL or a comma separated list of Gateway endpoints that support `?format=block|car|ipns-record`
responses. Either this variable of `STRN_ORCHESTRATOR_URL` must be set.
responses. Either this variable or `STRN_ORCHESTRATOR_URL` must be set.

If you're gateway does not support `?format=ipns-record`, you can use `IPNS_RECORD_GATEWAY`
If this gateway does not support `application/vnd.ipfs.ipns-record`, you can use `IPNS_RECORD_GATEWAY`
to override the gateway address from which to retrieve IPNS Records from.

### `IPNS_RECORD_GATEWAY`

Single URL or a comma separated list of Gateway endpoints that support `?format=ipns-record`.
Single URL or a comma separated list of Gateway endpoints that support requests for `application/vnd.ipfs.ipns-record`.
This is used for IPNS Record routing. If not set, the value of `PROXY_GATEWAY_URL` will be
used.

`IPNS_RECORD_GATEWAY` also supports [Routing V1 HTTP API](https://specs.ipfs.tech/routing/http-routing-v1/)
for IPNS Record routing. To use it, the provided URL must end with `/routing/v1`.
for IPNS Record routing ([IPIP-379](https://specs.ipfs.tech/ipips/ipip-0379/)). To use it, the provided URL must end with `/routing/v1`.

## Saturn Backend

Expand Down
2 changes: 1 addition & 1 deletion routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,5 @@ func (ps *proxyRouting) fetch(ctx context.Context, name ipns.Name) ([]byte, erro
}

func (ps *proxyRouting) getRandomGatewayURL() string {
return ps.gatewayURLs[ps.rand.Intn(len(ps.gatewayURLs))]
return strings.TrimSuffix(ps.gatewayURLs[ps.rand.Intn(len(ps.gatewayURLs))], "/")

Check warning on line 138 in routing.go

View check run for this annotation

Codecov / codecov/patch

routing.go#L137-L138

Added lines #L137 - L138 were not covered by tests
}

0 comments on commit 9a8e9d6

Please sign in to comment.