diff options
author | Ed Tanous <ed.tanous@intel.com> | 2018-07-25 00:38:06 +0300 |
---|---|---|
committer | Ed Tanous <ed.tanous@intel.com> | 2018-08-13 22:09:54 +0300 |
commit | b9845d9e0155564a7b1f4a52df2c0d99dbd0d4ec (patch) | |
tree | f7e850c7f748b6ade0c99bb6889714bb73b6caa5 /redfish-core/lib/redfish_sessions.hpp | |
parent | 8ceb2eca408311131e661227122b2a72a7f65938 (diff) | |
download | bmcweb-b9845d9e0155564a7b1f4a52df2c0d99dbd0d4ec.tar.xz |
Implement Location header for session auth
From the redfish specification 1.5.0, page 98:
"""
The response to the POST request to create a session shall include the
following:
...
A Location header that contains a hyperlink to the newly created session
resource
"""
This implements the location header properly, per specification.
Tested by:
Attempting POST on the Sessions resource, and observing a "Location"
header be set.
Change-Id: Ia62c385bedf67e6267d573771b04a211ba332f21
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Diffstat (limited to 'redfish-core/lib/redfish_sessions.hpp')
-rw-r--r-- | redfish-core/lib/redfish_sessions.hpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/redfish-core/lib/redfish_sessions.hpp b/redfish-core/lib/redfish_sessions.hpp index a32a660754..ca1c3757da 100644 --- a/redfish-core/lib/redfish_sessions.hpp +++ b/redfish-core/lib/redfish_sessions.hpp @@ -167,6 +167,9 @@ class SessionCollection : public Node { username); res.addHeader("X-Auth-Token", session->sessionToken); + res.addHeader("Location", + "/redfish/v1/SessionService/Sessions/" + session->uniqueId); + // Return data for created session memberSession.doGet(res, req, {session->uniqueId}); |