diff options
author | Matthieu Brouillard <matthieu@brouillard.fr> | 2015-08-09 12:27:05 +0200 |
---|---|---|
committer | Matthieu Brouillard <matthieu@brouillard.fr> | 2015-08-09 12:27:05 +0200 |
commit | cbdd9d819348d2169d190f305b32d5240d1f60fc (patch) | |
tree | dd1047c419e63f81126bef023845da61bf4b6fad /README.md | |
parent | c5c77ab76ec0ca68687fb1ab500239085a4a0c6f (diff) | |
download | nanohttpd-cbdd9d819348d2169d190f305b32d5240d1f60fc.tar.gz |
enhance CORS support to allow to define origin
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -112,10 +112,19 @@ NanoHTTPD project currently consist of four parts: * File server serves also very long files without memory overhead. * Contains a built-in list of most common MIME types. * Runtime extension support (extensions that serve particular MIME types) - example extension that serves Markdown formatted files. Simply including an extension JAR in the webserver classpath is enough for the extension to be loaded. -* Simple [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) support via `--cors` +* Simple [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) support via `--cors` paramater * by default serves `Access-Control-Allow-Headers: origin,accept,content-type` * possibility to set `Access-Control-Allow-Headers` by setting System property: `AccessControlAllowHeader` * _example: _ `-DAccessControlAllowHeader=origin,accept,content-type,Authorization` + * possible values: + * `--cors`: activates CORS support, `Access-Control-Allow-Origin` will be set to `*` + * `--cors=some_value`: `Access-Control-Allow-Origin` will be set to `some_value`. + +**_CORS argument examples_** + + +* `--cors=http://appOne.company.com` +* `--cors="http://appOne.company.com, http://appTwo.company.com"`: note the double quotes so that the 2 URLs are considered part of a single argument. ## Maven dependencies |