Welcome! Log In Create A New Profile

Advanced

Re: true 414 status code

Vladimir Getmanshchuk
September 06, 2013 03:50AM
Спасибо починилось.
Пусть тут полежит:

--- src/http/ngx_http_header_filter_module.c.orig 2013-05-13
10:43:28.000000000 +0000
+++ src/http/ngx_http_header_filter_module.c 2013-09-05 14:37:15.011369647
+0000
@@ -92,10 +92,7 @@
ngx_string("411 Length Required"),
ngx_string("412 Precondition Failed"),
ngx_string("413 Request Entity Too Large"),
- ngx_null_string, /* "414 Request-URI Too Large", but we never send it
- * because we treat such requests as the HTTP/0.9
- * requests and send only a body without a header
- */
+ ngx_string("414 Request-URI Too Large"),
ngx_string("415 Unsupported Media Type"),
ngx_string("416 Requested Range Not Satisfiable"),

@@ -270,6 +267,12 @@
len += NGX_INT_T_LEN;
status_line = NULL;
}
+
+ if (status_line && status_line->len == 0) {
+ status = r->headers_out.status;
+ len += NGX_INT_T_LEN;
+ status_line = NULL;
+ }
}

clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);


On Wed, Sep 4, 2013 at 1:51 PM, Валентин Бартенев <vbart@nginx.com> wrote:

> On Wednesday 04 September 2013 13:54:18 Vladimir Getmanshchuk wrote:
> > Даже идиотизм типа:
> >
> > error_page 414 =414 @414;
> >
> > location @414 {
> > return 414;
> > }
> > не дал результат - получаю 200
> >
> > 2013/09/04 09:40:10 [info] 5564#0: *45 client sent too long URI while
> > reading client request line, client: 123.123.123.123, server:
> > host.example.com, request: "GET
> >
> /file.php?qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasd
> >
> fghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiop
> >
> asdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyu
> >
> iopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwer
> >
> tyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmq
> >
> wertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvb
> >
> nmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzx
> >
> cvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjk
> >
> lzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfg
> >
> hjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopas
> >
> dfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuio
> >
> pasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwerty
> >
> uiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwe
> >
> rtyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnm
> >
> qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcv
> >
> bnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklz
> >
> xcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghj
> >
> klzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdf
> >
> ghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopa
> >
> sdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyui
> >
> opasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwert
> >
> yuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqw
> >
> ertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbn
> >
> mqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxc
> > vbnmqwertyuiopasdfghjklzxcvbnmqwer 2013/09/04 09:40:10 [debug] 5564#0:
> *45
> > http finalize request: 414, "?" a:1, c:1
> > 2013/09/04 09:40:10 [debug] 5564#0: *45 event timer del: 15:
> 1378287669763
> > 2013/09/04 09:40:10 [debug] 5564#0: *45 http special response: 414, "?"
> > 2013/09/04 09:40:10 [debug] 5564#0: *45 test location: "@414"
> > 2013/09/04 09:40:10 [debug] 5564#0: *45 using location: @414 "?"
> > 2013/09/04 09:40:10 [debug] 5564#0: *45 rewrite phase: 3
> > 2013/09/04 09:40:10 [debug] 5564#0: *45 http finalize request: 414, "?"
> > a:1, c:2
> > 2013/09/04 09:40:10 [debug] 5564#0: *45 http special response: 414, "?"
> > 2013/09/04 09:40:10 [debug] 5564#0: *45 http set discard body
> > 2013/09/04 09:40:10 [debug] 5564#0: *45 xslt filter header
> > 2013/09/04 09:40:10 [debug] 5564#0: *45 HTTP/1.1
> > Server: nginx/1.2.9
> > Date: Wed, 04 Sep 2013 09:40:10 GMT
> > Content-Type: text/html
> > Content-Length: 192
> > Connection: close
> >
> [..]
>
> Это не 200, а просто невалидный ответ. Патч, исправляющий проблему, уже
> лежит
> на ревью:
> http://mailman.nginx.org/pipermail/nginx-devel/2013-April/003609.html
>
> Плюс вдогонку ещё один:
>
> # HG changeset patch
> # User Valentin Bartenev <vbart@nginx.com>
> # Date 1378228039 -14400
> # Node ID 9f8ebfbe04f28544fd9cfc1473679aee13202506
> # Parent 659464c695b7c70f64207462d0e1a4ee3d018583
> Return reason phrase for 414.
>
> After 62be77b0608f nginx can return this code.
>
> diff -r 659464c695b7 -r 9f8ebfbe04f2
> src/http/ngx_http_header_filter_module.c
> --- a/src/http/ngx_http_header_filter_module.c Mon Sep 02 20:06:03 2013
> +0400
> +++ b/src/http/ngx_http_header_filter_module.c Tue Sep 03 21:07:19 2013
> +0400
> @@ -92,10 +92,7 @@ static ngx_str_t ngx_http_status_lines[]
> ngx_string("411 Length Required"),
> ngx_string("412 Precondition Failed"),
> ngx_string("413 Request Entity Too Large"),
> - ngx_null_string, /* "414 Request-URI Too Large", but we never send it
> - * because we treat such requests as the HTTP/0.9
> - * requests and send only a body without a header
> - */
> + ngx_string("414 Request-URI Too Large"),
> ngx_string("415 Unsupported Media Type"),
> ngx_string("416 Requested Range Not Satisfiable"),
>
>
> --
> Валентин
>
> _______________________________________________
> nginx-ru mailing list
> nginx-ru@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-ru
>



--
Yours sincerely,
Vladimir Getmanshchuk
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

true 414 status code

Vladimir Getmanshchuk August 31, 2013 04:34PM

Re: true 414 status code

VBart August 31, 2013 04:58PM

Re: true 414 status code

Gena Makhomed September 01, 2013 09:16AM

Re: true 414 status code

Валентин Бартенев September 01, 2013 07:10PM

Re: true 414 status code

Валентин Бартенев September 02, 2013 12:02AM

Re: true 414 status code

Gena Makhomed September 02, 2013 08:50AM

Re: true 414 status code

Vladimir Getmanshchuk September 02, 2013 09:00AM

Re: true 414 status code

Валентин Бартенев September 02, 2013 09:04AM

Re: true 414 status code

Vladimir Getmanshchuk September 03, 2013 02:30PM

Re: true 414 status code

Vladimir Getmanshchuk September 04, 2013 05:56AM

Re: true 414 status code

Валентин Бартенев September 04, 2013 06:52AM

Re: true 414 status code

Vladimir Getmanshchuk September 06, 2013 03:50AM

Re: true 414 status code

Vladimir Getmanshchuk September 01, 2013 04:36PM

Re: true 414 status code

Валентин Бартенев September 01, 2013 07:04PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 260
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready