Hello, I’m hosting a PHP endpoint on InfinityFree that exports registered student face images as a ZIP archive. The endpoint requires an X-Dataset-Token authentication header.
When my external Python server on Render requests the endpoint, it receives HTTP 200 with Content-Type: text/html and an HTML page loading /aes.js instead of the ZIP generated by PHP.
When I open the PHP endpoint directly in my browser without the authentication header, it displays “Unauthorized”, as expected.
Could you confirm whether InfinityFree’s security or browser-verification layer blocks authenticated server-to-server requests, and whether there is a supported solution?
Thank you.
Other Information
My PHP exporter previously showed a strict_types declaration error, which I fixed. When I open the exporter directly in my browser, it now displays “Unauthorized”, as expected without the authentication header.
The PHP endpoint is intended to return a ZIP archive of student face images to my Python application hosted on Render. The request includes the X-Dataset-Token header, but Render receives an HTML response containing JavaScript that loads /aes.js instead of the ZIP archive.
The endpoint URL is:
cicsattendance.site.je/face_dataset_export.php
Could you please help me determine why the security challenge is being returned to the server-to-server request and whether there is a supported solution?
Welcome to the InfinityFree community forum! Good to have you here.
Most people answering here are volunteers. They’re often the fastest source of help. Admin (the only staff member) checks in about once a day for issues on our end.
Volunteers can’t see your account or website. Share what you actually see, like error messages and what happens when you try something. That’s more useful than your theory of what’s wrong.
AI tools often get InfinityFree wrong. If a volunteer’s advice differs from what an AI told you, please try the volunteer’s suggestion first.
Solving an issue is a joint effort. Try the suggestions you get and report back what happened.
Beep boop, I’m a bot! I dug through the forum to get you started. I sometimes get things wrong though, so do with this what you will until a human has a look.
Yes, that’s the InfinityFree browser security system. Your request from Render was stopped before it reached your PHP, so the X-Dataset-Token header was never checked.
The article says a tool that can’t run the check gets a short HTML page, usually with status 200. That page loads /aes.js, sets a __test cookie and redirects to the same URL with ?i=1 added. That matches what Render receives. Your browser shows “Unauthorized” because it can run the check, so it reaches your script.
The check can’t be turned off for one URL, user agent or IP address. It can’t be turned off for the whole site either. Server-to-server access, REST APIs and automated scripts are all on the list of things that won’t work on free hosting.
Here’s the article:
It says the supported options are premium hosting, which uses less restrictive protection that lets APIs and automated tools work, or moving the endpoint somewhere that doesn’t use this check. Outbound requests from your site to other services do work. So the reverse direction might fit: your InfinityFree PHP could push the data to your Render app, instead of Render pulling it from InfinityFree. I haven’t found a source that covers that setup, so treat it as a suggestion.
Lemni got the reason why this is happening right, but I’m not completely sure yet about the proposed solution.
Sure, migrating to premium hosting will work, but for your specific use case (serving a ZIP file to an application on Render), it also feels like overkill to me. A web hosting account seems like a poor fit for your use case in general.
Where does this ZIP file actually come from? If it’s uploaded for somewhere else, maybe some kind of file hosting service is a better fit than a web hosting account. And if it’s generated here, then why not just move that work into your Python script on Render?