From 1d24537746c09f01ceeb987434c703f28bcea07f Mon Sep 17 00:00:00 2001 From: Kumar McMillan Date: Thu, 9 Mar 2017 11:15:16 -0600 Subject: [PATCH 1/2] Force /users/edit/ to be served by addons-server --- src/amo/routes.js | 5 ++++- tests/server/amo/TestViews.js | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/amo/routes.js b/src/amo/routes.js index fff800d107d..d964e892717 100644 --- a/src/amo/routes.js +++ b/src/amo/routes.js @@ -29,7 +29,10 @@ export default ( - {/* Hack to make the proxy serve this URL from addons-server */} + {/* These user routes are to make the proxy serve each URL from */} + {/* addons-server until we can fix the :visibleAddonType route below. */} + {/* https://github.com/mozilla/addons-frontend/issues/2029 */} + {/* https://github.com/mozilla/addons-frontend/issues/1975 */} diff --git a/tests/server/amo/TestViews.js b/tests/server/amo/TestViews.js index ce545f95802..3eb62968392 100644 --- a/tests/server/amo/TestViews.js +++ b/tests/server/amo/TestViews.js @@ -66,4 +66,8 @@ describe('AMO GET Requests', () => { it('should respond with a 404 to user pages', () => request(app) .get('/en-US/firefox/user/some-user/') .expect(404)); + + it('should respond with a 404 to the user edit page', () => request(app) + .get('/en-US/firefox/users/edit/') + .expect(404)); }); From afde0f25d3e4b82a7514205528c26740c5589ada Mon Sep 17 00:00:00 2001 From: Kumar McMillan Date: Thu, 9 Mar 2017 11:38:27 -0600 Subject: [PATCH 2/2] handle all user actions --- src/amo/routes.js | 3 ++- tests/server/amo/TestViews.js | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/amo/routes.js b/src/amo/routes.js index d964e892717..71c95eba9f1 100644 --- a/src/amo/routes.js +++ b/src/amo/routes.js @@ -32,7 +32,8 @@ export default ( {/* These user routes are to make the proxy serve each URL from */} {/* addons-server until we can fix the :visibleAddonType route below. */} {/* https://github.com/mozilla/addons-frontend/issues/2029 */} - + {/* We are mimicing these URLs: https://github.com/mozilla/addons-server/blob/master/src/olympia/users/urls.py#L20 */} + {/* https://github.com/mozilla/addons-frontend/issues/1975 */} diff --git a/tests/server/amo/TestViews.js b/tests/server/amo/TestViews.js index 3eb62968392..7f368db806a 100644 --- a/tests/server/amo/TestViews.js +++ b/tests/server/amo/TestViews.js @@ -70,4 +70,20 @@ describe('AMO GET Requests', () => { it('should respond with a 404 to the user edit page', () => request(app) .get('/en-US/firefox/users/edit/') .expect(404)); + + it('should respond with a 404 to a specific user edit', () => request(app) + .get('/en-US/firefox/users/edit/1234/') + .expect(404)); + + it('should respond with a 404 to user unsubscribe actions', () => request(app) + .get('/en-US/firefox/users/unsubscribe/token/signature/permission/') + .expect(404)); + + it('should respond with a 404 to deleting a user photo', () => request(app) + .get('/en-US/firefox/users/delete_photo/1234/') + .expect(404)); + + it('should respond with a 404 to any user action', () => request(app) + .get('/en-US/firefox/users/login/') + .expect(404)); });