Mercurial > hg > nginx
comparison src/http/modules/ngx_http_rewrite_module.c @ 3593:a79d2ad7a2d8 stable-0.7
merge r3487, r3525:
rewrite fixes:
*) escape ampersand in argument while rewrite
*) autodetect redirect if URI is rewritten to a string starting with $scheme
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 07 Jun 2010 11:51:37 +0000 |
parents | d51b734b4540 |
children |
comparison
equal
deleted
inserted
replaced
3592:fdd0943b277d | 3593:a79d2ad7a2d8 |
---|---|
338 regex->add_args = 1; | 338 regex->add_args = 1; |
339 } | 339 } |
340 | 340 |
341 last = 0; | 341 last = 0; |
342 | 342 |
343 if (ngx_strncmp(value[2].data, "http://", sizeof("http://") - 1) == 0) { | 343 if (ngx_strncmp(value[2].data, "http://", sizeof("http://") - 1) == 0 |
344 regex->status = NGX_HTTP_MOVED_TEMPORARILY; | 344 || ngx_strncmp(value[2].data, "https://", sizeof("https://") - 1) == 0 |
345 regex->redirect = 1; | 345 || ngx_strncmp(value[2].data, "$scheme", sizeof("$scheme") - 1) == 0) |
346 last = 1; | 346 { |
347 } | |
348 | |
349 if (ngx_strncmp(value[2].data, "https://", sizeof("https://") - 1) == 0) { | |
350 regex->status = NGX_HTTP_MOVED_TEMPORARILY; | 347 regex->status = NGX_HTTP_MOVED_TEMPORARILY; |
351 regex->redirect = 1; | 348 regex->redirect = 1; |
352 last = 1; | 349 last = 1; |
353 } | 350 } |
354 | 351 |