Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

192
Views
¿Qué está mal en mi implementación de nonce para un js en línea con csp y matraz?

Implementé un nonce para un csp en línea js. Luchando por encontrar por qué no funciona. Al acceder a una página aparece este error:

 Content Security Policy: The page's settings blocked the loading of a resource at https://loca.../script.js ("script-src"). Content Security Policy: The page's settings blocked the loading of a resource at inline ("script-src").

Implementado en el matraz: // Dentro del archivo timer.py se implementó una función para crear nonce.

 def GetCspNonce(): """Returns a random nonce.""" NONCE_LENGTH = 16 return base64.b64encode(os.urandom(NONCE_LENGTH)) nonce = GetCspNonce() function to redirect to a template: return render_template('base/timer.html', timer= timer, nonce=nonce)

// Agregado a init.py csp nonce.

 def create_app(): # create and configure the app .... csp = { 'default-src': ['\'self\''], 'script-src': ['https://www.goog....], 'nonce-{nonce}'],...

//temporizador.html

 <td> <p> ...</p> <script type="text/javascript" src="../static/text/script.js" nonce="{nonce}"></script> </td>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!