diff options
author | stickies-v <stickies-v@protonmail.com> | 2022-01-18 16:37:54 +0000 |
---|---|---|
committer | stickies-v <stickies-v@protonmail.com> | 2022-03-10 12:01:53 +0100 |
commit | fff771ee864975cee8c831651239bac95503c37a (patch) | |
tree | 7cf1a82cb5442ee3ae7436cb5145305f49726b6d /src/rest.h | |
parent | c1aad1b3b95b7c6bdf05e0c2095aba2f2db8310b (diff) | |
download | bitcoin-fff771ee864975cee8c831651239bac95503c37a.tar.xz |
Handle query string when parsing data format
URLs may contain a query string (prefixed with '?') and this should be ignored when parsing
the data format.
To facilitate testing this functionality, ParseDataFormat has been made non-static.
Diffstat (limited to 'src/rest.h')
-rw-r--r-- | src/rest.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/rest.h b/src/rest.h index e09541c47f..49b1c333d0 100644 --- a/src/rest.h +++ b/src/rest.h @@ -14,6 +14,15 @@ enum class RESTResponseFormat { JSON, }; +/** + * Parse a URI to get the data format and URI without data format + * and query string. + * + * @param[out] param The strReq without the data format string and + * without the query string (if any). + * @param[in] strReq The URI to be parsed. + * @return RESTResponseFormat that was parsed from the URI. + */ RESTResponseFormat ParseDataFormat(std::string& param, const std::string& strReq); #endif // BITCOIN_REST_H |