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

339
Visualizações
How to enable mixed content into your Next.js app with 3rd party npm

My web app is HTTPS but the targeted resource is HTTP. As a result, facing mixed-content issue:

Mixed Content: The page at 'https://app-website-dev.shikho.net/student/video-archive/a74c812b-82dd-417c-b07e-c4544911acac' was loaded over HTTPS, but requested an insecure resource 'http://res.cloudinary.com/cross-border-education-technologies-pte-ltd/image/upload/v1643522121/eofmak1yhic4n8chsrlo.pdf'. This request has been blocked; the content must be served over HTTPS.

I can fix the issue from browser settings but want something inside the code instead of from browser GUI (as all the users are not technical on this site).

How can I achieve this from the code level? So far I've visited CSP: block-all-mixed-content. Maybe something like syntax Content-Security-Policy: block-all-mixed-content; has to use in code?

Here is my code:

import React from "react";
import Viewer, { Worker } from "@phuocng/react-pdf-viewer";
import "@phuocng/react-pdf-viewer/cjs/react-pdf-viewer.css";

function StdPDFViewer({ url }) {
  return (
    <div
      className="pdf-container"
      style={{
        backgroundColor: "aliceblue",
        border: "1px solid rgba(0, 0, 0, 0.3)",
        display: "flex",
        flexDirection: "column",
        height: "100%"
      }}
    >
      <Worker workerUrl="https://unpkg.com/pdfjs-dist@2.5.207/build/pdf.worker.min.js">
        <div id="pdfViewer" style={{ height: "100vh" }}>
          <Viewer
            fileUrl={url}
            defaultScale={1}
            httpHeaders={{ key: "C6590A86-50504136-B572A792-D36E0771" }}
            withCredentials={true}
          />
        </div>
      </Worker>
    </div>
  );
}

export default StdPDFViewer;

I'm using React-PDF-Viewer where the documentation has options like httpHeaders

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