xref: /aosp_15_r20/external/cronet/net/http/http_cookie_indices.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2024 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef NET_HTTP_HTTP_COOKIE_INDICES_H_
6 #define NET_HTTP_HTTP_COOKIE_INDICES_H_
7 
8 #include <optional>
9 #include <string>
10 #include <vector>
11 
12 #include "net/base/net_export.h"
13 
14 namespace net {
15 
16 class HttpResponseHeaders;
17 
18 // Parse the Cookie-Indices response header, if present (even if the Vary header
19 // is not).
20 //
21 // Returns an empty optional if the header was absent, not a valid structured
22 // list, or contained an invalid/unrecognized item.
23 NET_EXPORT std::optional<std::vector<std::string>> ParseCookieIndices(
24     const HttpResponseHeaders& headers);
25 
26 }  // namespace net
27 
28 #endif  // NET_HTTP_HTTP_COOKIE_INDICES_H_
29