DEV: Respond with error 400 to uploads requested via XHR

follow-up to 13f38055
This commit is contained in:
Gerhard Schlager
2019-06-27 11:13:44 +02:00
parent df9b295510
commit fe870a1e54
2 changed files with 7 additions and 10 deletions

View File

@ -5,14 +5,7 @@ acceptance("User", { loggedIn: true });
QUnit.test("Invalid usernames", async assert => {
// prettier-ignore
server.get("/u/eviltrout%2F..%2F..%2F.json", () => { // eslint-disable-line no-undef
return [
404,
{ "Content-Type": "application/json" },
{
errors: ["The requested URL or resource could not be found."],
error_type: "not_found"
}
];
return [400, { "Content-Type": "application/json" }, {}];
});
await visit("/u/eviltrout%2F..%2F..%2F/summary");