FIX: Add secure media url to SERVER_SIDE_ONLY list (#11348)
This commit is contained in:
parent
2348a7972e
commit
5028aaf446
|
@ -16,6 +16,7 @@ const TOPIC_REGEXP = /\/t\/([^\/]+)\/(\d+)\/?(\d+)?/;
|
|||
const SERVER_SIDE_ONLY = [
|
||||
/^\/assets\//,
|
||||
/^\/uploads\//,
|
||||
/^\/secure-media-uploads\//,
|
||||
/^\/stylesheets\//,
|
||||
/^\/site_customizations\//,
|
||||
/^\/raw\//,
|
||||
|
|
|
@ -96,4 +96,15 @@ module("Unit | Utility | url", function () {
|
|||
"https://www.discourse.org/mailto:foo"
|
||||
);
|
||||
});
|
||||
|
||||
test("routeTo redirects secure media URLS because they are server side only", async function (assert) {
|
||||
sinon.stub(DiscourseURL, "redirectTo");
|
||||
sinon.stub(DiscourseURL, "handleURL");
|
||||
DiscourseURL.routeTo("/secure-media-uploads/original/1X/test.pdf");
|
||||
assert.ok(
|
||||
DiscourseURL.redirectTo.calledWith(
|
||||
"/secure-media-uploads/original/1X/test.pdf"
|
||||
)
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue