The headless Chrome needs to access XWiki in order to load the print preview page and print it to PDF. It cannot always use the same URL as the one used by the end user (the external URL) so we introduced the "XWiki URI" configuration, see XWIKI-20223. The problem is that the headless Chrome is always trying the external URL first, falling back on the configured XWiki URI only if it fails, which is unexpected by the administrator that sets the XWiki URI configuration. The fix is to try only the configured XWiki URI, when it is set, otherwise try the external URL first with a fallback on the default XWiki URI. |