Hi Sylvia,
Are you trying to redirect from within Webmin to that CUPS URL https://192.168.1.5:631 ?
If that Access-Control-Allow-Origin header is what's needed, you could output it before
the redirect with code like :
print "Access-Control-Allow-Origin: https://192.168.5.1:631\n";
&redirect("https://192.168.5.1:631");
On 08/Sep/2020 04:43 Sylvia Weber via webadmin-devel <web...@li...> wrote ..
> Hi,
>
> I am developing a custom webmin module and since a couple of days I am trying to
> get a redirection to another page (CUPS on the same server as Webmin) to work.
>
> When I am using the redirect-Function (&redirect("https://192.168.1.5:631")), the
> browser shows an error: CORS header 'Access-Control-Allow-Origin' missing.
>
> As mentioned in this bug (https://github.com/webmin/webmin/issues/1026), I added
> Access-Control-Allow-Origin: "https://192.168.5.1:631" to Extra HTTP headers in
> the Webmin Configuration but the result is the same. I also installed the browser
> add-on mentioned in issue 1026 (https://addons.mozilla.org/en-US/firefox/addon/cookies-and-headers-analyser/)
> which shows the value '"https' for access-control-allow-origin. (By the way I also
> tried with single and without quotation marks.) I don't know much about http headers,
> so I can't tell if Webmin or the add-on are cutting the value at the colon.
>
> I did some further tests: If I use PrintHeader() instead of ui_print_header() the
> link works fine.
>
> I am stuck now and don't know how to solve this problem.
>
> Thanks a lot in advance for hints and help!
> Sylvia
|