comparison src/core/ngx_string.h @ 4253:6efec8b1ff52 stable-1.0

Merging r4193, r4194: Autoindex fixes: *) Autoindex: escape '?' in file names. For files with '?' in their names autoindex generated links with '?' not escaped. This resulted in effectively truncated links as '?' indicates query string start. This is an updated version of the patch originally posted at [1]. It introduces generic NGX_ESCAPE_URI_COMPONENT which escapes everything but unreserved characters as per RFC 3986. This approach also renders unneeded special colon processing (as colon is percent-encoded now), it's dropped accordingly. [1] http://nginx.org/pipermail/nginx-devel/2010-February/000112.html *) Autoindex: escape html in file names.
author Igor Sysoev <igor@sysoev.ru>
date Tue, 01 Nov 2011 14:09:15 +0000
parents e7798b5e990a
children d620f497c50f
comparison
equal deleted inserted replaced
4252:94049ec3eeda 4253:6efec8b1ff52
187 uint32_t ngx_utf8_decode(u_char **p, size_t n); 187 uint32_t ngx_utf8_decode(u_char **p, size_t n);
188 size_t ngx_utf8_length(u_char *p, size_t n); 188 size_t ngx_utf8_length(u_char *p, size_t n);
189 u_char *ngx_utf8_cpystrn(u_char *dst, u_char *src, size_t n, size_t len); 189 u_char *ngx_utf8_cpystrn(u_char *dst, u_char *src, size_t n, size_t len);
190 190
191 191
192 #define NGX_ESCAPE_URI 0 192 #define NGX_ESCAPE_URI 0
193 #define NGX_ESCAPE_ARGS 1 193 #define NGX_ESCAPE_ARGS 1
194 #define NGX_ESCAPE_HTML 2 194 #define NGX_ESCAPE_URI_COMPONENT 2
195 #define NGX_ESCAPE_REFRESH 3 195 #define NGX_ESCAPE_HTML 3
196 #define NGX_ESCAPE_MEMCACHED 4 196 #define NGX_ESCAPE_REFRESH 4
197 #define NGX_ESCAPE_MAIL_AUTH 5 197 #define NGX_ESCAPE_MEMCACHED 5
198 #define NGX_ESCAPE_MAIL_AUTH 6
198 199
199 #define NGX_UNESCAPE_URI 1 200 #define NGX_UNESCAPE_URI 1
200 #define NGX_UNESCAPE_REDIRECT 2 201 #define NGX_UNESCAPE_REDIRECT 2
201 202
202 uintptr_t ngx_escape_uri(u_char *dst, u_char *src, size_t size, 203 uintptr_t ngx_escape_uri(u_char *dst, u_char *src, size_t size,