mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 04:15:28 +02:00
fix(security): add initial support for HSTS and CSP BE-11311 (#52)
This commit is contained in:
parent
55cda8c78e
commit
9421e9d452
5 changed files with 43 additions and 24 deletions
12
app/index.js
12
app/index.js
|
@ -21,6 +21,18 @@ import { onStartupAngular } from './app';
|
|||
import { configApp } from './config';
|
||||
import { constantsModule } from './ng-constants';
|
||||
|
||||
// http://localhost:49000 is a docker extension specific url (see /build/docker-extension/docker-compose.yml)
|
||||
if (window.origin == 'http://localhost:49000') {
|
||||
// we are loading the app from a local file as in docker extension
|
||||
document.getElementById('base').href = 'http://localhost:49000/';
|
||||
|
||||
window.ddExtension = true;
|
||||
} else {
|
||||
var path = window.location.pathname.replace(/^\/+|\/+$/g, '');
|
||||
var basePath = path ? '/' + path + '/' : '/';
|
||||
document.getElementById('base').href = basePath;
|
||||
}
|
||||
|
||||
initFeatureService(Edition[process.env.PORTAINER_EDITION]);
|
||||
|
||||
angular
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue