Add support for custom headers
Users might need custom headers. Especially, if you want to allow CORS. For example: Access-Control-Allow-Origin: 'https://www.example.com' Access-Control-Allow-Headers: 'cache-control'
This could be included in the server section of the config.xml
This seems like a reasonable request. Is it acceptable for your purposes to add these headers to every response (error or success, GET, PUT or OPTIONS?)
This is how I approached it. Making sure/disclaiming the headers are ALWAYS injected on a per-server basis.
I have done it for both legs of the first "if" statement of sendResponse: https://github.com/sbluhm/WebDAV-Daemon/blob/CustomHeaders/webdavd.c#L1589 https://github.com/sbluhm/WebDAV-Daemon/blob/CustomHeaders/webdavd.c#L1628 Would there be a better place?
Actually, I have the pull request ready now. Can you please have a look at line https://github.com/sbluhm/WebDAV-Daemon/blame/CustomHeaders/configuration.c#L283 for me? I am not releasing the memory for xmlTextReaderGetAttribute here and have no clue how to do this. According to the documentation, you have to de-allocate it.