diff options
author | Richard van Nieuwenhoven <richard.vannieuwenhoven@adesso.at> | 2015-09-13 08:01:26 +0200 |
---|---|---|
committer | Richard van Nieuwenhoven <richard.vannieuwenhoven@adesso.at> | 2015-09-13 08:01:26 +0200 |
commit | 4a3649d01c41f5cba8dd4c8b3c99d2e073395ff8 (patch) | |
tree | 0b2ee99ebe3155aa2bc533817f55fb1be8ac123b /README.md | |
parent | 52e133eaffa4906f4d85ec1374c99ee475ead36d (diff) | |
parent | cbdd9d819348d2169d190f305b32d5240d1f60fc (diff) | |
download | nanohttpd-4a3649d01c41f5cba8dd4c8b3c99d2e073395ff8.tar.gz |
Merge pull request #207 from McFoggy/cors-support
fixes #25 add basic CORS support
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -121,6 +121,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` 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 |