Files
Echoion/include/Core/ts6bot/Url.hpp
T
2026-01-18 18:22:09 +03:00

23 lines
500 B
C++

#pragma once
#include <cstdint>
#include <string>
namespace ts6bot::url {
// Percent-encode a string for use as a query parameter value.
std::string EncodeComponent(const std::string& s);
struct HttpUrl {
std::string host;
uint16_t port{};
std::string path; // begins with '/'
};
// Minimal parser for redirect URIs.
// Supports: http://<host>:<port>/<path>
// Throws std::runtime_error on invalid input.
HttpUrl ParseHttpUrl(const std::string& httpUrl);
} // namespace ts6bot::url