Comments (4)
You can have a look at send_mime()
, it is called from httpd_start_request()
. Good luck!
Lines 753 to 755 in 606774e
from merecat.
As a quick follow-up. I added the following line to the send_mime()
function from the merecat/src/libhttpd.c file you mentionned:
"Access-Control-Allow-Origin: *\r\n",
Before:
"Last-Modified: %s\r\n"
"Accept-Ranges: bytes\r\n",
hc->protocol, status, title, nowbuf, EXPOSED_SERVER_SOFTWARE, modbuf);
After:
"Last-Modified: %s\r\n"
"Accept-Ranges: bytes\r\n"
"Access-Control-Allow-Origin: *\r\n",
hc->protocol, status, title, nowbuf, EXPOSED_SERVER_SOFTWARE, modbuf);
It now adds the Access-Control-Allow-Origin: * header to every response, so ideally I would add it as a configurable parameter with a regex to target specific files (like they did here on another project monkey/monkey@d4d4dab) and choose if I allow any origin with * or be more specific. But that's for later as I'm no pro programmer and C is hard.
Thank you for your help and directing me in the right direction.
from merecat.
Thank you for the quick response. To make sure i understand your response, do you mean it cannot be done out-of-the-box and that I should modify the source code? If that's the case then I'm afraid it's out of my skills :( I was hoping there would be an option or something.
Thank you
from merecat.
Correct, you need to patch the code.
from merecat.
Related Issues (20)
- Setting environment variable for CGI HOT 3
- help me enable PHP HOT 25
- phpmyadmin in merecat? HOT 4
- Support for proxy-pass
- index.php does not run in subfolders HOT 2
- PHP with method GET does not work HOT 2
- http logging doesn't seem complete, even w/ -l debug HOT 3
- HTTP header line endings HOT 2
- Condition check resulted in Merecat web server being skipped
- build time issues with php support HOT 1
- Re-add thttpd-style logging? HOT 1
- make dist; make check fails: fatal: making test-suite.log: failed to create php.trs HOT 4
- Skip doc installation HOT 3
- mbedtls support? HOT 1
- 2 processes start? HOT 1
- Could not run CGI via merecat.conf HOT 1
- Bug in background HOT 1
- access.log HOT 3
- Performance issues ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from merecat.