mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Remove additional mount of content/images
refs 717567995b
- We should not be using relative URLs inside the admin panel anymore
- Removes a usage of "shared" middleware which isn't truly shared
This commit is contained in:
parent
dbafaf7205
commit
406218489c
2 changed files with 0 additions and 15 deletions
|
@ -61,19 +61,6 @@ module.exports = function setupParentApp(options = {}) {
|
|||
adminApp.use('/ghost/.well-known', require('./well-known')());
|
||||
adminApp.use('/ghost', require('../services/auth/session').createSessionFromToken, require('./admin')());
|
||||
|
||||
// TODO: remove {admin url}/content/* once we're sure the API is not returning relative asset URLs anywhere
|
||||
// only register this route if the admin is separate so we're not overriding the {site}/content/* route
|
||||
if (hasSeparateAdmin) {
|
||||
adminApp.use(
|
||||
STATIC_IMAGE_URL_PREFIX,
|
||||
[
|
||||
shared.middlewares.image.handleImageSizes,
|
||||
storage.getStorage().serve(),
|
||||
shared.middlewares.errorHandler.handleThemeResponse
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
// ADMIN + API
|
||||
// with a separate admin url only serve on that host, otherwise serve on all hosts
|
||||
const adminVhostArg = hasSeparateAdmin && adminHost ? adminHost : /.*/;
|
||||
|
|
|
@ -82,8 +82,6 @@ describe('parent app', function () {
|
|||
it('should mount and assign correct routes', function () {
|
||||
parentApp();
|
||||
|
||||
use.calledWith('/content/images').should.be.true();
|
||||
|
||||
vhostSpy.calledTwice.should.be.true();
|
||||
vhostSpy.firstCall.calledWith('admin.ghost.blog').should.be.true();
|
||||
vhostSpy.secondCall.calledWith(/^(?!admin\.ghost\.blog).*/).should.be.true();
|
||||
|
|
Loading…
Add table
Reference in a new issue