Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

152
Visualizações
CSP Style Attribute

I'm trying to block all inline styles and style attributes in my app and used nonce for validation. I see in chrome, style tags are getting blocked but not the style attribute. I'm getting the CSP error in the console for the style attribute but the style is getting applied for the element. Can anyone please help me resolving this issue.

Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self' localhost:3000 unsafe-hashes 'report-sample' 'nonce-7LV1f57teStNOnc3tYd44w=='". Either the 'unsafe-inline' keyword, a hash ('sha256-8f935d27GvUutRyY9yWScUMiFUk4WTdZURISiYfPOeQ='), or a nonce ('nonce-...') is required to enable inline execution. Note that hashes do not apply to event handlers, style attributes and javascript: navigations unless the 'unsafe-hashes' keyword is present.

module CSP STYLE_SRC = [:report_sample] SCRIPT_SRC = [:report_sample] end

unless Utility.asset_precompile? Rails.application.config.content_security_policy do |policy| policy.script_src *[CSP::SELF_DOMAIN_SRC, CSP::INTERNAL_SRC, CSP::SCRIPT_SRC].flatten().compact policy.style_src *[CSP::SELF_DOMAIN_SRC, CSP::INTERNAL_SRC, CSP::STYLE_SRC].flatten().compact end end

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda