From 5c83d603d6ece1fc2c97d7fc0233799bdf4d8a22 Mon Sep 17 00:00:00 2001
From: Ray Schamp <ray@scratch.mit.edu>
Date: Fri, 14 Dec 2018 08:25:10 -0500
Subject: [PATCH] Use 3.0 routes for GETs

This should have happened a long time ago, but the Fastly config prevented it
---
 src/lib/storage.js                | 2 +-
 test/integration/examples.test.js | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/lib/storage.js b/src/lib/storage.js
index 142d81878..a3f240685 100644
--- a/src/lib/storage.js
+++ b/src/lib/storage.js
@@ -36,7 +36,7 @@ class Storage extends ScratchStorage {
         this.projectHost = projectHost;
     }
     getProjectGetConfig (projectAsset) {
-        return `${this.projectHost}/internalapi/project/${projectAsset.assetId}/get/`;
+        return `${this.projectHost}/${projectAsset.assetId}`;
     }
     getProjectCreateConfig () {
         return {
diff --git a/test/integration/examples.test.js b/test/integration/examples.test.js
index 8408c88f3..7e8ff7a10 100644
--- a/test/integration/examples.test.js
+++ b/test/integration/examples.test.js
@@ -40,9 +40,9 @@ describe('player example', () => {
             .then(pLogs => pLogs.map(log => JSON.parse(log.message).message)
                 .filter(m => m.method === 'Network.requestWillBeSent')
                 .map(m => m.params.request.url)
-                .filter(url => url === 'https://projects.scratch.mit.edu/internalapi/project/96708228/get/')
+                .filter(url => url === 'https://projects.scratch.mit.edu/96708228')
             );
-        await expect(projectRequests).toEqual(['https://projects.scratch.mit.edu/internalapi/project/96708228/get/']);
+        await expect(projectRequests).toEqual(['https://projects.scratch.mit.edu/96708228']);
     });
 });
 
@@ -71,9 +71,9 @@ describe('blocks example', () => {
             .then(pLogs => pLogs.map(log => JSON.parse(log.message).message)
                 .filter(m => m.method === 'Network.requestWillBeSent')
                 .map(m => m.params.request.url)
-                .filter(url => url === 'https://projects.scratch.mit.edu/internalapi/project/96708228/get/')
+                .filter(url => url === 'https://projects.scratch.mit.edu/96708228')
             );
-        await expect(projectRequests).toEqual(['https://projects.scratch.mit.edu/internalapi/project/96708228/get/']);
+        await expect(projectRequests).toEqual(['https://projects.scratch.mit.edu/96708228']);
     });
 
     test('Change categories', async () => {
-- 
GitLab