Premium support for our pure JavaScript UI components


Post by jk@datapult.dk »

Hi there

I hope that you are well.

I am trying to understand this section here https://github.com/bryntum/pdf-export-server/blob/main/docs/architecture.md#remote-web-server-remote-export-server

We need to set page origin. We can do it by providing clientUrl. It is a URL that puppeteer navigates to before replacing page content with our index.html. From server's point of view page is not a regular client which is browsing http://production.org/app

I am struggling to interpret a lot of the phrases but the most important

From server's point of view page is not a regular client

What does it mean that "a page is not a client"?

Let us say that I configure PdfExport.clientUrl = "https://production.com/pdf-export-client-url"

On this URL should my server:

  1. Do something regarding CORS or CSP?
  2. Return or redirect?

Lastly, is the above even needed? On the official scheduler export example, you do this

pdfExport : { exportServer: 'https://dev.bryntum.com:8082', }

https://bryntum.com/products/scheduler/examples/export/


Post by Maxim Gorkovsky »

Hello.
Maybe we need to revisit this. What it means is that puppeteer on the PDF export server does not set page origin, it does not navigate anywhere. It opens blank page and puts HTML content right into it. And then browser security might block some requests if remote server is sending security headers (CSP, CORS).
When you set it, page opens the passed URL first, which sets origin and allows browser security to function properly. Usually, clientUrl config is not needed unless logs say requests are blocked.


Post Reply