@mpgd/game-services 0.19.0 → 0.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,7 +15,8 @@ export function createGooglePlayPublisherClient(options) {
15
15
  response = await requestFetch(`${publisherOrigin}${path}`, {
16
16
  method,
17
17
  headers: { Authorization: `Bearer ${accessToken}` },
18
- redirect: 'error',
18
+ // Workers reject redirect: 'error'; a manual 3xx/opaque redirect is never ok and fails below.
19
+ redirect: 'manual',
19
20
  signal,
20
21
  });
21
22
  }
@@ -26,7 +27,8 @@ export function createGooglePlayPublisherClient(options) {
26
27
  // Fetch errors can contain the request URL (including the purchase token).
27
28
  throw new Error('Google Play Publisher request failed.');
28
29
  }
29
- if (!response.ok) {
30
+ // Also reject a redirect followed by an injected fetch that ignores redirect: 'manual'.
31
+ if (!response.ok || response.redirected) {
30
32
  await discardBody(response);
31
33
  // Do not forward an error body or URL: both can contain purchase credentials.
32
34
  throw new Error(`Google Play Publisher request failed (HTTP ${response.status}).`);
@@ -17,10 +17,12 @@ export function createOnePlayPurchaseClient(input) {
17
17
  try {
18
18
  const response = await requestFetch(`${origin}${path}`, {
19
19
  ...init,
20
- redirect: 'error',
20
+ // Workers reject redirect: 'error'; a manual 3xx/opaque redirect is never ok and fails below.
21
+ redirect: 'manual',
21
22
  signal,
22
23
  });
23
- if (!response.ok) {
24
+ // Also reject a redirect followed by an injected fetch that ignores redirect: 'manual'.
25
+ if (!response.ok || response.redirected) {
24
26
  if (response.status === 401) {
25
27
  cached = undefined;
26
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpgd/game-services",
3
- "version": "0.19.0",
3
+ "version": "0.19.1",
4
4
  "description": "Client, contract, server, store, and test helpers for authoritative mpgd game services.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -186,9 +186,9 @@
186
186
  "@orpc/client": "2.0.0-beta.14",
187
187
  "@orpc/contract": "2.0.0-beta.14",
188
188
  "@orpc/server": "2.0.0-beta.14",
189
- "@mpgd/analytics": "0.4.3",
190
- "@mpgd/catalog": "0.8.0",
191
- "@mpgd/platform": "0.17.0"
189
+ "@mpgd/analytics": "0.4.4",
190
+ "@mpgd/catalog": "0.8.1",
191
+ "@mpgd/platform": "0.18.0"
192
192
  },
193
193
  "devDependencies": {
194
194
  "@opentelemetry/api": "1.9.0",