<div dir="ltr">Thanks for your fast response.<div><br></div><div>It fails in edge, and firefox too, so unfortunately not just chrome.</div><div><br></div><div>I agree with you that the IIS server is violating the spec - it should never attempt to send UTF-8 encoded characters in the header, but it does so anyway and it works with chome, firefox and edge when using http1.1 (they must autodetect the utf-8 encoding) - but with http/2 it fails on the transport level somewhere.</div><div><br></div><div>I guess that undertow should not really try to guess a codepage and encode it different, so there is probably not anything else to do - I just wanted to check if there could be another bug that caused the protocol violation error, or if you know of the http/2 spec mentioning anything about this, or if undertow did something special with non-ascii characters.</div><div><br></div><div>I&#39;ll try encoding the header if I detect non-ascii characters in it and see how it goes...</div><div><br></div><div>Below is the information from a trace in my proxy - sorry for the image, but it doesn&#39;t cut&#39;n paste well - the odd characters in the Content-Disposition field are UTF-8 encoded version of of the danish letter &quot;å&quot; (&amp;aring; in html)</div><div><br></div><div><div><div><img src="cid:ii_jj87m13o1_1646945303935dcc" style="margin-right: 25px;"><br></div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-07-05 3:10 GMT+02:00 Stuart Douglas <span dir="ltr">&lt;<a href="mailto:sdouglas@redhat.com" target="_blank">sdouglas@redhat.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><br><div class="gmail_quote"><span class=""><div dir="ltr">On Wed, Jul 4, 2018 at 6:15 PM Kim Rasmussen &lt;<a href="mailto:kr@asseco.dk" target="_blank">kr@asseco.dk</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I have a setup where I have my own variant of a ProxyHandler within undertow.</div><div>In one case, I proxy requests towards an IIS running MailEnable - if I try to download a webmail attachment where the filename contains non-ascii characters, MailEnable sends the filename in UTF-8 characters in the HTTP header.</div><div><br></div><div>I guess this is kinda a violation of the HTTP protocol, but thats how it is.</div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>When I run my undertow proxy using HTTP1.1 between the browser and undertow, everything works as expected - the browser detects and supports UTF-8 characters in the filename in the HTTP headers.</div><div>But, if I run HTTP/2 between the browser and undertow, using Chrome I am getting an SPDY_PROTOCOL_ERROR displayed within chrome.</div></div></blockquote><div><br></div></span><div>Does it work with other browsers? Its possible that we have a bug in how we handle this, but I think it is more likely that chrome is just being more strict with HTTP/2 and enforcing the spec.</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>So, I guess that it is because Chrome chokes on the UTF-8 characters in the HTTP/2 headers - I tried digging into the spec but I cannot really find anything mentioned there regarding restrictions on header content - just on header naming.</div></div></blockquote><div><br></div></span><div><a href="https://tools.ietf.org/html/rfc7230" target="_blank">https://tools.ietf.org/html/<wbr>rfc7230</a><br></div><div><br></div><div>&quot;   Historically, HTTP has allowed field content with text in the</div><div>   ISO-8859-1 charset [ISO-8859-1], supporting other charsets only</div><div>   through use of [RFC2047] encoding.  In practice, most HTTP header</div><div>   field values use only a subset of the US-ASCII charset [USASCII].</div><div>   Newly defined header fields SHOULD limit their field values to</div><div>   US-ASCII octets.  A recipient SHOULD treat other octets in field</div><div>   content (obs-text) as opaque data.&quot;</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>Any suggestions ? I could of course strip the invalid characters from the response header before forwarding them but wanted to check if there is a better way first....<br clear="all"></div></div></blockquote><div><br></div></span><div>Maybe you could use RFC2047 encoding, although I don&#39;t think it is particularly widely used, but I guess chrome probably supports it. </div><div><br></div><div>Looking at our HTTP/2 encoder it does not attempt to deal with UTF-8 at all, it just casts the character to a byte, so we would not be encoding the characters properly anyway, but I am not sure if it matters as I don&#39;t think the browser would treat them as UTF-8 anyway.</div><div><br></div><div>Stuart</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class=""><div dir="ltr"><div><div><br></div>-- <br><div class="m_-7941074243292910609gmail-m_3949205584039342372gmail_signature"><div dir="ltr"><div><span style="font-family:arial,sans-serif;border-collapse:collapse"><div style="font-size:13px"><span style="font-family:verdana,sans-serif;font-size:13px">Med venlig hilsen / Best regards</span></div><div><p style="font-size:13px"><b><span lang="EN-GB" style="font-size:10pt"><font color="#000066"><font face="verdana, sans-serif"><span style="color:rgb(34,34,34);background-color:rgb(255,255,255)">Kim Rasmussen</span></font></font></span></b><b><span lang="EN-GB" style="color:rgb(0,51,102)"><font face="verdana, sans-serif"><br></font></span></b><span lang="EN-GB" style="font-size:10pt;color:rgb(102,102,102)"><font face="verdana, sans-serif">Partner, IT Architect</font></span></p><p style="font-size:13px"><b><span lang="EN-GB" style="font-size:10pt;color:rgb(102,102,102)"><font face="verdana, sans-serif">Asseco Denmark A/S</font></span></b><span lang="EN-GB" style="font-size:10pt;color:rgb(102,102,102)"><font face="verdana, sans-serif"><b><br></b><a href="https://maps.google.com/?q=Kronprinsessegade+54+DK-1306+Copenhagen&amp;entry=gmail&amp;source=g">Kronprinsessegade 54</a><br><a href="https://maps.google.com/?q=Kronprinsessegade+54+DK-1306+Copenhagen&amp;entry=gmail&amp;source=g">DK-1306 Copenhagen</a> K<br>Mobile: +45 26 16 40 23<br>Ph.: +45 33 36 46 60<br>Fax: +45 33 36 46 61</font></span></p><p><span lang="EN-GB" style="color:rgb(102,102,102)"><span style="font-family:verdana,sans-serif"><span style="font-size:13.3333px"><a href="https://ceptor.io" target="_blank">https://ceptor.io</a><br></span></span></span><span style="font-size:10pt;font-family:verdana,sans-serif;color:rgb(102,102,102)"><a href="https://asseco.dk" target="_blank">https://asseco.dk</a></span></p><p style="font-size:13px"><span lang="EN-GB" style="font-size:10pt;color:rgb(102,102,102)"><font face="verdana, sans-serif"><br></font></span></p></div></span></div></div></div>
</div></div></span>
______________________________<wbr>_________________<br>
undertow-dev mailing list<br>
<a href="mailto:undertow-dev@lists.jboss.org" target="_blank">undertow-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/undertow-dev</a></blockquote></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><span style="font-family:arial,sans-serif;border-collapse:collapse"><div style="font-size:13px"><span style="font-family:verdana,sans-serif;font-size:13px">Med venlig hilsen / Best regards</span></div><div><p style="font-size:13px"><b><span lang="EN-GB" style="font-size:10pt"><font color="#000066"><font face="verdana, sans-serif"><span style="color:rgb(34,34,34);background-color:rgb(255,255,255)">Kim Rasmussen</span></font></font></span></b><b><span lang="EN-GB" style="color:rgb(0,51,102)"><font face="verdana, sans-serif"><br></font></span></b><span lang="EN-GB" style="font-size:10pt;color:rgb(102,102,102)"><font face="verdana, sans-serif">Partner, IT Architect</font></span></p><p style="font-size:13px"><b><span lang="EN-GB" style="font-size:10pt;color:rgb(102,102,102)"><font face="verdana, sans-serif">Asseco Denmark A/S</font></span></b><span lang="EN-GB" style="font-size:10pt;color:rgb(102,102,102)"><font face="verdana, sans-serif"><b><br></b>Kronprinsessegade 54<br>DK-1306 Copenhagen K<br>Mobile: +45 26 16 40 23<br>Ph.: +45 33 36 46 60<br>Fax: +45 33 36 46 61</font></span></p><p><span lang="EN-GB" style="color:rgb(102,102,102)"><span style="font-family:verdana,sans-serif"><span style="font-size:13.3333px"><a href="https://ceptor.io" target="_blank">https://ceptor.io</a><br></span></span></span><span style="font-size:10pt;font-family:verdana,sans-serif;color:rgb(102,102,102)"><a href="https://asseco.dk" target="_blank">https://asseco.dk</a></span></p><p style="font-size:13px"><span lang="EN-GB" style="font-size:10pt;color:rgb(102,102,102)"><font face="verdana, sans-serif"><br></font></span></p></div></span></div></div></div>
</div>