diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-09-06 12:34:05 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-09-06 12:34:05 +0200 |
commit | 4b8b967e58e9f692a69d70890cc09ec0fc557eb0 (patch) | |
tree | 2251a2e581f8f59ed88da7960c409ded2968877f /src/wallet.ts | |
parent | 761397bdf20069f04159fcab5b1220f7e723cf42 (diff) |
fix 5745: add version-based cache breaker for /keys and /wire
Diffstat (limited to 'src/wallet.ts')
-rw-r--r-- | src/wallet.ts | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/wallet.ts b/src/wallet.ts index cec656ad0..175a6dba1 100644 --- a/src/wallet.ts +++ b/src/wallet.ts @@ -130,7 +130,7 @@ interface SpeculativePayData { */ export const WALLET_PROTOCOL_VERSION = "3:0:0"; -const WALLET_CACHE_BREAKER = "01"; +const WALLET_CACHE_BREAKER_CLIENT_VERSION = "2"; const builtinCurrencies: CurrencyRecord[] = [ { @@ -786,7 +786,10 @@ export class Wallet { ); } else { if (uriResult.sessionId) { - await this.submitPay(differentPurchase.contractTermsHash, uriResult.sessionId); + await this.submitPay( + differentPurchase.contractTermsHash, + uriResult.sessionId, + ); } return { status: "paid", @@ -1662,7 +1665,9 @@ export class Wallet { */ async getWireInfo(exchangeBaseUrl: string): Promise<ExchangeWireJson> { exchangeBaseUrl = canonicalizeBaseUrl(exchangeBaseUrl); - const reqUrl = new URI("wire").absoluteTo(exchangeBaseUrl); + const reqUrl = new URI("wire") + .absoluteTo(exchangeBaseUrl) + .addQuery("cacheBreaker", WALLET_CACHE_BREAKER_CLIENT_VERSION); const resp = await this.http.get(reqUrl.href()); if (resp.status !== 200) { @@ -1967,7 +1972,7 @@ export class Wallet { baseUrl = canonicalizeBaseUrl(baseUrl); const keysUrl = new URI("keys") .absoluteTo(baseUrl) - .addQuery("cacheBreaker", WALLET_CACHE_BREAKER); + .addQuery("cacheBreaker", WALLET_CACHE_BREAKER_CLIENT_VERSION); const keysResp = await this.http.get(keysUrl.href()); if (keysResp.status !== 200) { throw Error("/keys request failed"); |