rgw: with CORS support

With CORS test cases

1. Added license headers to the cors files
2. SIWFT POST metadata for cors will replace the old cors configuration
3. Fixed a buf in rgw_cors_swift.h

With Yehuda's review comments along with some fixes;
1. If the origin is allowed only for https, we should not approve the same host for http requests
2. Accounted for hostname situtation like www.www.org, or www.wowwww.com or www.*
3. Replaced atoi with strtol
4. Have a centralized place for parsing host names, hence avoiding duplicates

Checked certain senarios with amazon S3 and made changes accordingly

With some fixes in rgw_cors.cc and str_list.cc

Removing the whitespace auto-append to the delimiters in get_str_list(), added white spaces delimiters in is_string_in_set()
rgw: cors, style fixes, other fixes

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: more cors fixes

Remove the check for read_cors_config in rgw_main.cc, and changes type of 'a' to unsigned from long as max_age cannot be a negative integer

Modified the type of 'a' to unsigned long and used ULONG_MAX and strtol in rgw_cors_swift.h

Signed-off-by: Babu Shanmugam <anbu@enovance.com>
rgw: fix a few warnings

Adjust data types

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Makefile.am: change some cors rules

The cors unitest should be a standalone test (not part of the make
unitests) as it requires having a running gateway and needs input params
to run correctly.
Also update missing header files.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: add missing include file

Add missing limits.h, needed for ULONG_MAX.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: fix warning

On a 64-bit arch, we still want to make sure it's a 32-bit value.  Gcc is
too smart for us to just cast; it will still warn on 32-bit arch that the
comparison is always true.

Signed-off-by: Sage Weil <sage@inktank.com>
Merge remote-tracking branch 'gh/wip-cors-rebased'

Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
Merge git://github.com/ceph/ceph