48#define N_URL_SAFE_HOST_MAX 253u
50#define N_URL_SAFE_MAX 1024u
52#define N_URL_SAFE_MIME_MAX 127u
54#define N_URL_SAFE_HEAD_MAX 16384u
119int n_url_safe_resolve(
const char* base,
size_t base_len,
const char* loc,
size_t loc_len,
char* out,
size_t cap);
134int n_url_safe_find(
const char* text,
size_t len,
char* out,
size_t cap);
#define N_URL_SAFE_MIME_MAX
Longest captured Content-Type (mime), parameters dropped.
int n_url_safe_resolve(const char *base, size_t base_len, const char *loc, size_t loc_len, char *out, size_t cap)
resolve a redirect Location against a request URL
char location[1024u+1]
Location (redirects).
int n_url_safe_find(const char *text, size_t len, char *out, size_t cap)
find the first http(s) URL in a block of text
long long content_length
Content-Length, or -1 if absent.
size_t head_len
bytes through the terminating CRLFCRLF
int chunked
Transfer-Encoding: chunked present.
#define N_URL_SAFE_MAX
Longest URL / path / Location accepted.
int status
HTTP status code, e.g.
char content_type[127u+1]
mime, params dropped
int n_url_safe_head_parse(const char *buf, size_t len, n_url_safe_head *out)
parse an HTTP/1.x response head from [buf, buf+len)
int https
1 = https (default port 443), 0 = http (80)
#define N_URL_SAFE_HOST_MAX
Longest hostname / IP literal accepted (RFC 1035 limit).
int n_url_safe_parse(const char *url, size_t len, n_url_safe *out)
parse an absolute http(s) URL [url, url+len) into a bounded struct
The parts of an absolute http(s) URL.
The response-head fields a fetcher acts on.