Content security ( CSP )

Search for a command to run...

No comments yet. Be the first to comment.
Variable Variables are for storing data values. In Golang there are available data types for variables are string, int, boolean, and float32. There are 2 ways to declare the variable First way is to declare a variable using the var keyword Second ...

A go file has the following parts: Package declaration Import packages main() function Example: package main import "fmt" func main() { fmt.Println("Hello World!") } package keyword defines the package name because every program is a part of t...

Go language statically typed language, compiled programming language designed at Google. Infrastructure has changed a lot in years with cloud and multi-core processors. As it said the infrastructure is scalable & distributed, and dynamic has more cap...

Statically Typed Languages Statically typed language needs to define variable data type before compiling the program Because the compiler doesn’t understand the type of variable value whether it’s string or integer. Example: public class Main { p...

CSP is a layer that helps to prevent certain types of attacks including Cross-Site Scripting ( XSS ) and data injection attacks. These types of attacks are used to deface websites and steal data.
CSP is designed to be fully backward compatible.
Basically, there are two ways to use the CSP, First way is to set Content-Security-Policy in HTTP Header and the second way is to set element in HTML <head>.
Header Example:
<?php
header("Content-Security-Policy: default-src 'self'");
?>
HTML Example:
<meta http-equiv="Content-Security-Policy"
content="default-src 'self'; img-src https://*; child-src 'none';">