comparison src/http/modules/ngx_http_rewrite_module.c @ 3524:ca24774c16e3

autodetect redirect if URI is rewritten to a string starting with $scheme
author Igor Sysoev <igor@sysoev.ru>
date Sun, 23 May 2010 19:36:12 +0000
parents 42c16d8bddbe
children 187783310b65
comparison
equal deleted inserted replaced
3523:66a244ee8cf7 3524:ca24774c16e3
339 regex->add_args = 1; 339 regex->add_args = 1;
340 } 340 }
341 341
342 last = 0; 342 last = 0;
343 343
344 if (ngx_strncmp(value[2].data, "http://", sizeof("http://") - 1) == 0) { 344 if (ngx_strncmp(value[2].data, "http://", sizeof("http://") - 1) == 0
345 regex->status = NGX_HTTP_MOVED_TEMPORARILY; 345 || ngx_strncmp(value[2].data, "https://", sizeof("https://") - 1) == 0
346 regex->redirect = 1; 346 || ngx_strncmp(value[2].data, "$scheme", sizeof("$scheme") - 1) == 0)
347 last = 1; 347 {
348 }
349
350 if (ngx_strncmp(value[2].data, "https://", sizeof("https://") - 1) == 0) {
351 regex->status = NGX_HTTP_MOVED_TEMPORARILY; 348 regex->status = NGX_HTTP_MOVED_TEMPORARILY;
352 regex->redirect = 1; 349 regex->redirect = 1;
353 last = 1; 350 last = 1;
354 } 351 }
355 352