| 68 | }; |
| 69 | |
| 70 | static void HttpUrl_EncodeUrl(cc_string* dst, const cc_string* src) { |
| 71 | cc_uint8 data[4]; |
| 72 | int i, len; |
| 73 | char c; |
| 74 | |
| 75 | for (i = 0; i < src->length; i++) { |
| 76 | c = src->buffer[i]; |
| 77 | len = Convert_CP437ToUtf8(c, data); |
| 78 | |
| 79 | /* URL path/query must not be URL encoded (it normally would be) */ |
| 80 | if (c == '/' || c == '?' || c == '=' || c == '&') { |
| 81 | String_Append(dst, c); |
| 82 | } else { |
| 83 | Http_UrlEncode(dst, data, len); |
| 84 | } |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | static const cc_string url_rewrite_srcs[] = { |
| 89 | #define URL_REMAP_FUNC(src_base, src_host, dst_base, dst_host) String_FromConst(src_host), |
no test coverage detected