Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Calculator

0

94
Views
Refused to execute inline script because it violates the following Content Security Policy directive: "default-src 'self'"

My Html file looks like below. When I launch the HTML file it says, content security policy is broken. How do I fix it from the HTML side?

<html>

<head>

  <title></title>
</head>
<script type="text/javascript" src="URLCode.js"></script>

<body onload='window.location.replace(URLalter(window.location.href));'>
</body>

</html>

Js code:

function URLalter(entryURL) {
  var entryPoint= entryURL+" ";
  return entryPoint;
}
7 months ago · Juan Pablo Isaza
1 answers
Answer question

0

How do I fix it from the HTML side?

Easy answer, you don't. The server is most definitely responsible for this and with good reason but let's say those reasons are simply security. You may bypass this by adjusting your headers but it will not be done on a client level side at all!

That's bad.

You can maybe get comfortable with these security features often applied and understand the different headers/measures taken: contentSecurityPolicy, dnsPrefetchControl, expectCt, frameguard, hidePoweredBy, hsts, ieNoOpen, noSniff, permittedCrossDomainPolicies, referrerPolicy, and xssFilter

7 months ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2023 PeakU Inc. All Rights Reserved.