From edd162cf3bfcb1dcc21ed19289441a538317e8dc Mon Sep 17 00:00:00 2001 From: Ivan Vilata-i-Balaguer Date: Fri, 9 Mar 2018 14:19:30 +0100 Subject: [PATCH] Add Access-Control-Expose-Headers field constant: This response header is described both in [CORS](https://www.w3.org/TR/cors/) and [Fetch](https://fetch.spec.whatwg.org/) specifications. --- doc/qbk/09_releases.qbk | 2 ++ include/boost/beast/http/field.hpp | 1 + include/boost/beast/http/impl/field.ipp | 3 ++- test/beast/http/field.cpp | 1 + tools/field.txt | 1 + 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/qbk/09_releases.qbk b/doc/qbk/09_releases.qbk index 05341101..81585145 100644 --- a/doc/qbk/09_releases.qbk +++ b/doc/qbk/09_releases.qbk @@ -118,6 +118,8 @@ to update to the latest Boost release. * ([issue 1012]) Add asio_handler_invoke overloads for stream algorithms +* Add Access-Control-Expose-Headers field constant + [*API Changes] * Remove unintended public members of diff --git a/include/boost/beast/http/field.hpp b/include/boost/beast/http/field.hpp index 3d1446ad..09d9dfff 100644 --- a/include/boost/beast/http/field.hpp +++ b/include/boost/beast/http/field.hpp @@ -38,6 +38,7 @@ enum class field : unsigned short access_control_allow_headers, access_control_allow_methods, access_control_allow_origin, + access_control_expose_headers, access_control_max_age, access_control_request_headers, access_control_request_method, diff --git a/include/boost/beast/http/impl/field.ipp b/include/boost/beast/http/impl/field.ipp index 8da470ff..467a40ae 100644 --- a/include/boost/beast/http/impl/field.ipp +++ b/include/boost/beast/http/impl/field.ipp @@ -26,7 +26,7 @@ namespace detail { struct field_table { using array_type = - std::array; + std::array; struct hash { @@ -104,6 +104,7 @@ struct field_table "Access-Control-Allow-Headers", "Access-Control-Allow-Methods", "Access-Control-Allow-Origin", + "Access-Control-Expose-Headers", "Access-Control-Max-Age", "Access-Control-Request-Headers", "Access-Control-Request-Method", diff --git a/test/beast/http/field.cpp b/test/beast/http/field.cpp index 71046c7a..7fbf541a 100644 --- a/test/beast/http/field.cpp +++ b/test/beast/http/field.cpp @@ -50,6 +50,7 @@ public: match(field::access_control_allow_headers, "Access-Control-Allow-Headers"); match(field::access_control_allow_methods, "Access-Control-Allow-Methods"); match(field::access_control_allow_origin, "Access-Control-Allow-Origin"); + match(field::access_control_expose_headers, "Access-Control-Expose-Headers"); match(field::access_control_max_age, "Access-Control-Max-Age"); match(field::access_control_request_headers, "Access-Control-Request-Headers"); match(field::access_control_request_method, "Access-Control-Request-Method"); diff --git a/tools/field.txt b/tools/field.txt index 9f15ab16..bc7926ce 100644 --- a/tools/field.txt +++ b/tools/field.txt @@ -13,6 +13,7 @@ Access-Control-Allow-Credentials Access-Control-Allow-Headers Access-Control-Allow-Methods Access-Control-Allow-Origin +Access-Control-Expose-Headers Access-Control-Max-Age Access-Control-Request-Headers Access-Control-Request-Method