Asked 2 years ago
25 Apr 2022
Views 610
sandip

sandip posted

PHP : How to set Feature Policy security header ?

How to set 'Feature Policy' security header in PHP?

i want to set 'Feature Policy' header with following value:

Feature-Policy  camera 'none'; fullscreen 'self'; geolocation *;
Rasi

Rasi
answered Apr 25 '22 00:00

use header() method of the PHP to send the Feature-Policy header attribute


header("Feature-Policy: microphone 'none'; camera 'none';");

let me explain what the above code do :
it will send header to the browser with Feature-Policy properties
microphone 'none' means for the current website user cant use the microphone
camera 'none' means for the current website user cant use the camera
Post Answer