Commit Graph

6 Commits

Author SHA1 Message Date
André Kugland
defc1e8ce9
Custom headers with the CLI option --header (#28)
These changes add a command-line option --header, e.g. --header 'Access-Control-Allow-Origin: *'.

Basic tests are included for this option.

When accepting the argument, a very simple sanitization is made, the string is required to contain ": ", and can’t contain a '\n' character. These checks are far from what is required to truly validate a HTTP header, but will at least detect simple mistakes and forbid the abuse of having arguments that include more than one header, or, worse, that include a body for the response (after "\r\n\r\n").

This should also close the Issue #16 and PR #27, I think, since CORS functionality can be obtained by specifying a custom header.
2022-12-06 21:46:52 +11:00
artemis everfree
47920915c7
Update illumos support to the modern era (#24)
* Update Solaris / Illumos support

Old versions of Solaris did not have vasprintf, so darkhttpd defined one
gated behind an ifdef. Oracle Solaris 10 has had vasprintf since 2011.
Oracle Solaris 11 has had it since release. illumos (which also reports
as `__sun`) also has it in all current incarnations. As a result, this
ifdef'd block creates compiler errors due to a second definition of the
function. This commit removes the block.

This commit also adds `-lsendfile` to the Makefile for systems that
report as `SunOS` in `uname` (Solaris and Illumos), which is necessary
to link successfully in current day.

* Comment on manually specifying CC in readme

Some systems, including versions of illumos I use, do not have a `cc`
alias to the system C compiler. Arguably this is a flaw in the
distribution, but as a user, it's perhaps helpful to be reminded that
this is an option.
2022-10-02 11:56:40 +11:00
Solt Budavári
5c0f9babf1
Properly divide list "headers" and lists. (#4)
Since the feature (and security and limitations) list follows the
"Features:" (etc.) line without any empty lines between them,
some Markdown-to-HTML converters (correctly) assume that
they are one paragraph, which causes the list not to
be converted to an actual HTML list. By putting an empty line
between the actual lists and their preceding lines,
the lists will be correctly converted.

(Both lists and paragraphs are block elements,
and they should be "marked down" accordingly.
See https://daringfireball.net/projects/markdown/syntax#block .)
2021-04-08 11:32:56 +10:00
Miles Elam
35c488b95f
Dockerize (#3)
Add static build option to Makefile and create Dockerfile to run it.
2021-04-03 18:08:52 +11:00
Emil Mikulic
1845a4aa93 Update readme: add introduction, markdown. 2021-01-18 00:44:28 +11:00
Emil Mikulic
fdf28d2ede Rename README. 2021-01-18 00:34:04 +11:00