Skip to content

Commit f42934e

Browse files
authored
Force all /users/ URLs to be served by addons-server (#2034)
1 parent 0e9cc3e commit f42934e

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/amo/routes.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ export default (
2929
<IndexRoute component={Home} />
3030
<Route path="addon/:slug/" component={DetailPage} />
3131
<Route path="addon/:addonSlug/reviews/" component={AddonReviewList} />
32-
{/* Hack to make the proxy serve this URL from addons-server */}
32+
{/* These user routes are to make the proxy serve each URL from */}
33+
{/* addons-server until we can fix the :visibleAddonType route below. */}
34+
{/* https://github.com/mozilla/addons-frontend/issues/2029 */}
35+
{/* We are mimicing these URLs: https://github.com/mozilla/addons-server/blob/master/src/olympia/users/urls.py#L20 */}
36+
<Route path="users/:userAction/" component={NotFound} />
3337
{/* https://github.com/mozilla/addons-frontend/issues/1975 */}
3438
<Route path="user/:user/" component={NotFound} />
3539
<Route path=":visibleAddonType/categories/" component={CategoryList} />

tests/server/amo/TestViews.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,24 @@ describe('AMO GET Requests', () => {
6666
it('should respond with a 404 to user pages', () => request(app)
6767
.get('/en-US/firefox/user/some-user/')
6868
.expect(404));
69+
70+
it('should respond with a 404 to the user edit page', () => request(app)
71+
.get('/en-US/firefox/users/edit/')
72+
.expect(404));
73+
74+
it('should respond with a 404 to a specific user edit', () => request(app)
75+
.get('/en-US/firefox/users/edit/1234/')
76+
.expect(404));
77+
78+
it('should respond with a 404 to user unsubscribe actions', () => request(app)
79+
.get('/en-US/firefox/users/unsubscribe/token/signature/permission/')
80+
.expect(404));
81+
82+
it('should respond with a 404 to deleting a user photo', () => request(app)
83+
.get('/en-US/firefox/users/delete_photo/1234/')
84+
.expect(404));
85+
86+
it('should respond with a 404 to any user action', () => request(app)
87+
.get('/en-US/firefox/users/login/')
88+
.expect(404));
6989
});

0 commit comments

Comments
 (0)