Add img-src and media-src to Content-Security-Policy header for files and media proxy (#8188)
				
					
				
			* add img-src and media-src to csp in file and media proxy * add csp changes to changelog * sort and remove trailing semicolon
This commit is contained in:
		
							parent
							
								
									29b33b37ee
								
							
						
					
					
						commit
						380d14f406
					
				
					 3 changed files with 4 additions and 2 deletions
				
			
		|  | @ -18,7 +18,7 @@ const _dirname = dirname(_filename); | |||
| const app = new Koa(); | ||||
| app.use(cors()); | ||||
| app.use(async (ctx, next) => { | ||||
| 	ctx.set('Content-Security-Policy', `default-src 'none'; style-src 'unsafe-inline'`); | ||||
| 	ctx.set('Content-Security-Policy', `default-src 'none'; img-src 'self'; media-src 'self'; style-src 'unsafe-inline'`); | ||||
| 	await next(); | ||||
| }); | ||||
| 
 | ||||
|  |  | |||
|  | @ -11,7 +11,7 @@ import { proxyMedia } from './proxy-media'; | |||
| const app = new Koa(); | ||||
| app.use(cors()); | ||||
| app.use(async (ctx, next) => { | ||||
| 	ctx.set('Content-Security-Policy', `default-src 'none'; style-src 'unsafe-inline'`); | ||||
| 	ctx.set('Content-Security-Policy', `default-src 'none'; img-src 'self'; media-src 'self'; style-src 'unsafe-inline'`); | ||||
| 	await next(); | ||||
| }); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue