author | Michael Krelin <hacker@klever.net> | 2007-11-23 22:18:54 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-11-24 07:09:40 (UTC) |
commit | 70f85314fcd188a182aae3a4291c0cd95ba16ee2 (patch) (side-by-side diff) | |
tree | cad4bf188542d4319280a3c30757e72ec2d20bf6 /include | |
parent | 2589c69c4a909563098365fba141082db4657353 (diff) | |
download | libopkele-70f85314fcd188a182aae3a4291c0cd95ba16ee2.zip libopkele-70f85314fcd188a182aae3a4291c0cd95ba16ee2.tar.gz libopkele-70f85314fcd188a182aae3a4291c0cd95ba16ee2.tar.bz2 |
added URI normalization procedure to opkele::util
as specified in RFC3896, section 6
Signed-off-by: Michael Krelin <hacker@klever.net>
-rw-r--r-- | include/opkele/util.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/opkele/util.h b/include/opkele/util.h index edc1859..085c9e6 100644 --- a/include/opkele/util.h +++ b/include/opkele/util.h @@ -117,17 +117,27 @@ namespace opkele { * Encode binary data using base64. * @param data pointer to binary data * @param length length of data * @return encoded data */ string encode_base64(const void *data,size_t length); /** * Decode binary data from base64 representation. * @param data base64-encoded data * @param rv container for decoded binary */ void decode_base64(const string& data,vector<unsigned char>& rv); + + /** + * Normalize http(s) URI according to RFC3986, section 6. URI is + * expected to have scheme: in front of it. + * @param uri URI + * @return normalized URI + * @throw not_implemented in case of non-httpi(s) URI + * @throw bad_input in case of malformed URI + */ + string rfc_3986_normalize_uri(const string& uri); } } #endif /* __OPKELE_UTIL_H */ |