Mercurial > urweb
comparison src/c/request.c @ 1169:420e38516dc2
Normalize URLs to deal with page names that contain apostrophes
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 25 Feb 2010 15:08:52 -0500 |
parents | e6eabf0c5ccc |
children | 236dc296c32d |
comparison
equal
deleted
inserted
replaced
1168:69f1d39d3f2d | 1169:420e38516dc2 |
---|---|
126 int is_post = 0; | 126 int is_post = 0; |
127 char *boundary = NULL; | 127 char *boundary = NULL; |
128 size_t boundary_len = 0; | 128 size_t boundary_len = 0; |
129 char *inputs; | 129 char *inputs; |
130 const char *prefix = uw_get_url_prefix(ctx); | 130 const char *prefix = uw_get_url_prefix(ctx); |
131 char *s; | |
132 | |
133 for (s = path; *s; ++s) { | |
134 if (s[0] == '%' && s[1] == '2' && s[2] == '7') { | |
135 s[0] = '\''; | |
136 memmove(s+1, s+3, strlen(s+3)+1); | |
137 } | |
138 } | |
131 | 139 |
132 uw_set_currentUrl(ctx, path); | 140 uw_set_currentUrl(ctx, path); |
133 | 141 |
134 if (!strcmp(method, "POST")) { | 142 if (!strcmp(method, "POST")) { |
135 char *clen_s = uw_Basis_requestHeader(ctx, "Content-length"); | 143 char *clen_s = uw_Basis_requestHeader(ctx, "Content-length"); |