mirror of
				https://github.com/mickael-kerjean/filestash.git
				synced 2025-10-31 18:16:00 +08:00 
			
		
		
		
	feature (transcoding): update csp
This commit is contained in:
		| @ -48,7 +48,7 @@ func IndexHeaders(fn func(App, http.ResponseWriter, *http.Request)) func(ctx App | |||||||
| 		header.Set("X-Frame-Options", "DENY") | 		header.Set("X-Frame-Options", "DENY") | ||||||
| 		header.Set("X-Powered-By", fmt.Sprintf("Filestash/%s.%s <https://filestash.app>", APP_VERSION, BUILD_DATE)) | 		header.Set("X-Powered-By", fmt.Sprintf("Filestash/%s.%s <https://filestash.app>", APP_VERSION, BUILD_DATE)) | ||||||
|  |  | ||||||
| 		cspHeader := "default-src 'none'; style-src 'unsafe-inline'; font-src 'self' data:; manifest-src 'self'; script-src 'self' 'sha256-JNAde5CZQqXtYRLUk8CGgyJXo6C7Zs1lXPPClLM1YM4=' 'sha256-9/gQeQaAmVkFStl6tfCbHXn8mr6PgtxlH+hEp685lzY='; img-src 'self' data: https://maps.wikimedia.org; connect-src 'self'; object-src 'self'; media-src 'self'; worker-src 'self'; form-action 'self'; base-uri 'self';" | 		cspHeader := "default-src 'none'; style-src 'unsafe-inline'; font-src 'self' data:; manifest-src 'self'; script-src 'self' 'sha256-JNAde5CZQqXtYRLUk8CGgyJXo6C7Zs1lXPPClLM1YM4=' 'sha256-9/gQeQaAmVkFStl6tfCbHXn8mr6PgtxlH+hEp685lzY='; img-src 'self' data: https://maps.wikimedia.org; connect-src 'self'; object-src 'self'; media-src 'self' blob:; worker-src 'self' blob:; form-action 'self'; base-uri 'self';" | ||||||
| 		if allowedDomainsForIframe := Config.Get("features.protection.iframe").Schema(func(f *FormElement) *FormElement{ | 		if allowedDomainsForIframe := Config.Get("features.protection.iframe").Schema(func(f *FormElement) *FormElement{ | ||||||
| 			if f == nil { | 			if f == nil { | ||||||
| 				f = &FormElement{} | 				f = &FormElement{} | ||||||
|  | |||||||
| @ -136,6 +136,7 @@ func hls_playlist(reader io.ReadCloser, ctx *App, res *http.ResponseWriter, req | |||||||
| 		response += fmt.Sprintf("/hls/hls_%d.ts?path=%s\n", i, cacheName) | 		response += fmt.Sprintf("/hls/hls_%d.ts?path=%s\n", i, cacheName) | ||||||
| 	} | 	} | ||||||
| 	response += "#EXT-X-ENDLIST\n" | 	response += "#EXT-X-ENDLIST\n" | ||||||
|  | 	(*res).Header().Set("Content-Type", "application/x-mpegURL") | ||||||
| 	return NewReadCloserFromBytes([]byte(response)), nil | 	return NewReadCloserFromBytes([]byte(response)), nil | ||||||
| } | } | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Mickael Kerjean
					Mickael Kerjean