• Dear Cerberus X User!

    As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.

    Important: If you accept the amended Terms and Rules, you agree to the transfer of your user data to the future forum owner!

    Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.

    Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!

    Accepting ensures:

    - Continued access to your account with a short break for the actual transfer.

    - Retention of your data under the same terms.

    Without consent:

    - You don't have further access to your forum user account.

    - Your account and personal data will be deleted after April 5, 2024.

    - Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.

    We hope to keep you in our community and see you on the forum soon!

    All the best

    Your Cerberus X Team

HttpRequest returns nothing

Holzchopf

Well-known member
3rd Party Module Dev
Tutorial Author
Joined
Jul 31, 2017
Messages
500
When I run examples/mojo/mak/httprequest it runs fine. But when I change this line
Code:
get_req=New HttpRequest( "GET","https://httpbin.org/",Self )
to this:
Code:
get_req=New HttpRequest( "GET","https://holzchopf.ch/home.xml",Self )

It stops working. At least in the HTML5 target, in GLFW it keeps working.

What am I missing?
 
HttpRequest for HTML5 only works when your app runs on the same server where you do the request to. So when you upload your app to holzchopf.ch it should work from there.

That's a limitation due to that sandbox security stuff...
 
Haha good question. Actually I have no idea.
 
Opera. On Win10.

When trying to reach holzchopf.ch, the js console says
Failed to load https://holzchopf.ch/home.xml: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:53401' is therefore not allowed access.

No such message for httpbin.org

Did a quick research. Because my server doesn't send a 'Access-Control-Allow-Origin' header the browser defaults it's value - which is blocking the response. So without access to the resource server (or more specifically it's config for access control), loading those resources won't work. Too bad =(

btw. httpbin.org's response header contains 'Access-Control-Allow-Origin: http://localhost:53401'


Conclusion: Everything works as it should. Which is bad for my because it's supposed not to work the way I wanted.
 
You might not have to have access to the server's config; I think you can just set the access-control-allow-origin header directly on the page you're trying to connect to. I ran into the same problem trying to talk to a php script but was able to fix it by adding this to the top:

header("access-control-allow-origin: *");

Dunno how to set headers in HTML, though.
 
Thank you. I have to look if I can somehow elaborate in my problem.
 
Back
Top Bottom