Mercurial > hg > nginx-quic
annotate docs/xslt/changes.xslt @ 5324:8ef1722143dc
SPDY: do not reject headers with empty value (ticket #396).
A quote from SPDY draft 2 specification: "The length of each name and
value must be greater than zero. A receiver of a zero-length name or
value must send a RST_STREAM with code PROTOCOL error."
But it appears that Chrome browser allows sending requests over SPDY/2
connection using JavaScript that contain headers with empty values.
For better compatibility across SPDY clients and to be compliant with
HTTP, such headers are no longer rejected.
Also, it is worth noting that in SPDY draft 3 the statement has been
changed so that it permits empty values for headers.
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Thu, 15 Aug 2013 19:16:09 +0400 |
parents | 76bc29f06168 |
children | db6d07dbef3c |
rev | line source |
---|---|
450 | 1 <?xml version="1.0" encoding="utf-8"?> |
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> | |
3 | |
4028
76bc29f06168
CHANGES conversion from KOI8-R to UTF-8.
Igor Sysoev <igor@sysoev.ru>
parents:
4026
diff
changeset
|
4 <xsl:output method="text"/> |
450 | 5 |
6 <xsl:param select="'en'" name="lang"/> | |
4014 | 7 |
450 | 8 <xsl:param select="'../xml/change_log_conf.xml'" name="configuration"/> |
9 | |
10 <xsl:variable select="document($configuration)/configuration" name="conf"/> | |
4014 | 11 |
450 | 12 <xsl:variable select="$conf/start" name="start"/> |
4014 | 13 |
450 | 14 <xsl:variable select="$conf/indent" name="indent"/> |
4014 | 15 |
450 | 16 <xsl:variable select="$conf/length" name="max"/> |
4014 | 17 |
450 | 18 <xsl:variable name="br"><br></xsl:variable> |
4014 | 19 |
450 | 20 <xsl:template match="/"> |
21 <xsl:apply-templates select="change_log"/> | |
22 </xsl:template> | |
4014 | 23 |
450 | 24 <xsl:template match="change_log"> |
25 <xsl:apply-templates select="changes"/> | |
26 </xsl:template> | |
4014 | 27 |
450 | 28 <xsl:template match="changes"> |
4014 | 29 |
450 | 30 <xsl:text> |
31 </xsl:text> | |
32 | |
33 <xsl:value-of select="substring(concat($conf/changes[@lang=$lang]/title, //change_log/@title, ' ', @ver, ' '), 1, $conf/changes[@lang=$lang]/length)"/> | |
34 | |
35 <xsl:if test="$lang='ru'"> | |
36 <xsl:value-of select="@date"/> | |
37 </xsl:if> | |
38 | |
39 <xsl:if test="$lang='en'"> | |
4014 | 40 |
450 | 41 <xsl:value-of select="substring(@date, 1, 2)"/> |
4014 | 42 |
450 | 43 <xsl:value-of select="$conf/changes[@lang=$lang]/month[number(substring(current()/@date, 4, 2))]"/> |
4014 | 44 |
450 | 45 <xsl:value-of select="substring(@date, 7, 4)"/> |
46 </xsl:if> | |
4014 | 47 |
450 | 48 <xsl:text> |
49 </xsl:text> | |
50 | |
51 <xsl:apply-templates select="change"/> | |
52 | |
53 <xsl:text> | |
54 </xsl:text> | |
55 </xsl:template> | |
56 | |
57 <xsl:template match="change"> | |
4014 | 58 |
450 | 59 <xsl:variable select="$conf/changes[@lang=$lang]/*[local-name(.)=current()/@type]" name="prefix"/> |
60 | |
61 <xsl:variable name="postfix"> | |
62 <xsl:if test="$prefix"> | |
63 <xsl:text>: </xsl:text> | |
64 </xsl:if> | |
65 </xsl:variable> | |
66 | |
67 <xsl:apply-templates select="para[@lang=$lang]"> | |
68 <xsl:with-param select="concat($start, $prefix, $postfix)" name="prefix"/> | |
69 </xsl:apply-templates> | |
70 </xsl:template> | |
71 | |
72 <xsl:template match="para" name="para"> | |
73 <xsl:param name="prefix"/> | |
4014 | 74 |
450 | 75 <xsl:variable name="text"> |
76 <xsl:apply-templates/> | |
77 </xsl:variable> | |
78 | |
79 <xsl:text> | |
80 </xsl:text> | |
81 | |
82 <xsl:call-template name="wrap"> | |
83 <xsl:with-param select="normalize-space($text)" name="text"/> | |
84 <xsl:with-param name="prefix"> | |
85 <xsl:choose> | |
4014 | 86 |
450 | 87 <xsl:when test="position() = 1"> |
88 <xsl:value-of select="$prefix"/> | |
89 </xsl:when> | |
90 <xsl:otherwise> | |
91 <xsl:value-of select="$indent"/> | |
92 </xsl:otherwise> | |
93 </xsl:choose> | |
94 </xsl:with-param> | |
95 </xsl:call-template> | |
96 </xsl:template> | |
97 | |
98 <xsl:template name="wrap"> | |
99 <xsl:param name="text"/> | |
100 <xsl:param name="prefix"/> | |
4014 | 101 |
450 | 102 <xsl:if test="$text"> |
4014 | 103 |
450 | 104 <xsl:variable name="offset"> |
4024 | 105 |
450 | 106 <xsl:choose> |
107 <xsl:when test="starts-with($text, concat($br, ' '))"> | |
108 <xsl:value-of select="string-length($br) + 2"/> | |
109 </xsl:when> | |
4024 | 110 <xsl:when test="starts-with($text, $br)"> |
111 <xsl:value-of select="string-length($br) + 1"/> | |
112 </xsl:when> | |
450 | 113 <xsl:otherwise> |
4024 | 114 1</xsl:otherwise> |
450 | 115 </xsl:choose> |
116 </xsl:variable> | |
117 | |
118 <xsl:variable name="length"> | |
4014 | 119 |
450 | 120 <xsl:call-template name="length"> |
121 <xsl:with-param select="substring($text, $offset)" name="text"/> | |
122 <xsl:with-param select="string-length($prefix)" name="prefix"/> | |
123 <xsl:with-param select="$max" name="length"/> | |
124 </xsl:call-template> | |
125 </xsl:variable> | |
4014 | 126 |
450 | 127 <xsl:value-of select="$prefix"/> |
128 | |
4026
34c91abf6048
XSLT regeneration for the previous commit.
Igor Sysoev <igor@sysoev.ru>
parents:
4024
diff
changeset
|
129 <xsl:value-of select="normalize-space(translate(substring($text, $offset, $length), ' ', ' '))"/> |
450 | 130 |
131 <xsl:text> | |
132 </xsl:text> | |
133 | |
134 <xsl:call-template name="wrap"> | |
135 <xsl:with-param select="substring($text, $length + $offset)" name="text"/> | |
136 <xsl:with-param select="$indent" name="prefix"/> | |
137 </xsl:call-template> | |
138 </xsl:if> | |
139 </xsl:template> | |
4014 | 140 |
450 | 141 <xsl:template name="length"> |
142 <xsl:param name="text"/> | |
143 <xsl:param name="prefix"/> | |
144 <xsl:param name="length"/> | |
4014 | 145 |
4024 | 146 <xsl:variable select="substring-before(substring($text, 1, $length - $prefix + string-length($br)), $br)" name="break"/> |
4014 | 147 |
450 | 148 <xsl:choose> |
149 <xsl:when test="$break"> | |
150 <xsl:value-of select="string-length($break)"/> | |
151 </xsl:when> | |
152 <xsl:when test="$length = 0"> | |
4024 | 153 <xsl:value-of select="$max - $prefix"/> |
450 | 154 </xsl:when> |
4024 | 155 <xsl:when test="string-length($text) + $prefix <= $length"> |
450 | 156 <xsl:value-of select="$length - $prefix"/> |
157 </xsl:when> | |
4024 | 158 <xsl:when test="substring($text, $length - $prefix + 1, 1) = ' '"> |
159 <xsl:value-of select="$length - $prefix + 1"/> | |
160 </xsl:when> | |
450 | 161 <xsl:otherwise> |
4024 | 162 |
450 | 163 <xsl:call-template name="length"> |
164 <xsl:with-param select="$text" name="text"/> | |
165 <xsl:with-param select="$prefix" name="prefix"/> | |
166 <xsl:with-param select="$length - 1" name="length"/> | |
167 </xsl:call-template> | |
168 </xsl:otherwise> | |
169 </xsl:choose> | |
170 </xsl:template> | |
171 | |
172 <xsl:template match="at">@</xsl:template> | |
4014 | 173 |
450 | 174 <xsl:template match="br"> |
175 <xsl:value-of select="$br"/> | |
176 </xsl:template> | |
4014 | 177 |
450 | 178 <xsl:template match="nobr"> |
179 <xsl:value-of select="translate(., ' ', ' ')"/> | |
180 </xsl:template> | |
4014 | 181 |
182 </xsl:stylesheet> |