comparison src/core/ngx_string.h @ 4192:61e4af19df9f

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 Reported by Konstantin Leonov.
author Maxim Dounin <mdounin@mdounin.ru>
date Tue, 11 Oct 2011 17:56:51 +0000
parents e7798b5e990a
children d620f497c50f
comparison
equal deleted inserted replaced
4191:08d8af70760c 4192:61e4af19df9f
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,