{"id":498,"date":"2010-05-06T14:38:42","date_gmt":"2010-05-06T13:38:42","guid":{"rendered":"http:\/\/www.streppone.it\/cosimo\/blog\/2010\/05\/a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension\/"},"modified":"2010-05-06T14:38:42","modified_gmt":"2010-05-06T13:38:42","slug":"a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension","status":"publish","type":"post","link":"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/05\/a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension\/","title":{"rendered":"A couple of bugs fixed on the varnish accept-language VCL extension"},"content":{"rendered":"<p>Today I received a report of a bug in how the Opera.com startup page was presented to some browsers. In particular, people with Brazilian language.<\/p>\n<p>This was traced down to being a bug in the <a href=\"http:\/\/my.opera.com\/cstrep\/blog\/2010\/01\/23\/my-opera-front-page-caching-and-varnish-hacking\" rel=\"nofollow\">accept-language.vcl<\/a> extension that we are using on both My Opera and Opera.com.<\/p>\n<p>In particular, the bug had to do with static buffers being reused and overwritten during the <code>Accept-Language<\/code> string parsing, essentially due to my non-optimal C skills :) Now this bug is fixed and <a href=\"http:\/\/github.com\/cosimo\/varnish-accept-language\/commit\/04f9a631747d245762e91ec6c192a3effdde5bad\" rel=\"nofollow\">new test cases were added<\/a>, so to hopefully avoid regressions in the future.<\/p>\n<p>So now clients with Accept-Language containing strings like <code>pt-BR<\/code>, <code>es-ca<\/code>, <code>zh-CN<\/code>, etc&#8230; will be correctly recognized by the VCL code, and they will get the correct page served by varnish.<\/p>\n<p>As always, thanks to Opera, <a href=\"http:\/\/github.com\/cosimo\/varnish-accept-language\" rel=\"nofollow\">the code is freely available<\/a>, and I have to say it&#39;s not really experimental dangerous stuff anymore. It&#39;s been quite proven in the last few months (these few bugs excluded). At least your Varnish server shouldn&#39;t explode :-) Have fun!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I received a report of a bug in how the Opera.com startup page was presented to some browsers. In particular, people with Brazilian language. This was traced down to being a bug in the accept-language.vcl extension that we are using on both My Opera and Opera.com. In particular, the bug had to do with [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[265,453,211,89,454,60,249],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>A couple of bugs fixed on the varnish accept-language VCL extension - Random hacking<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/05\/a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A couple of bugs fixed on the varnish accept-language VCL extension - Random hacking\" \/>\n<meta property=\"og:description\" content=\"Today I received a report of a bug in how the Opera.com startup page was presented to some browsers. In particular, people with Brazilian language. This was traced down to being a bug in the accept-language.vcl extension that we are using on both My Opera and Opera.com. In particular, the bug had to do with [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/05\/a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension\/\" \/>\n<meta property=\"og:site_name\" content=\"Random hacking\" \/>\n<meta property=\"article:published_time\" content=\"2010-05-06T13:38:42+00:00\" \/>\n<meta name=\"author\" content=\"cosimo\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"cosimo\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/05\/a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/05\/a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension\/\"},\"author\":{\"name\":\"cosimo\",\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/c443bedbf6ecf99550d6395620801df1\"},\"headline\":\"A couple of bugs fixed on the varnish accept-language VCL extension\",\"datePublished\":\"2010-05-06T13:38:42+00:00\",\"dateModified\":\"2010-05-06T13:38:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/05\/a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension\/\"},\"wordCount\":180,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/c443bedbf6ecf99550d6395620801df1\"},\"keywords\":[\"accept-language\",\"caching\",\"language\",\"myopera\",\"opera.com\",\"varnish\",\"vcl\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/05\/a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/05\/a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension\/\",\"url\":\"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/05\/a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension\/\",\"name\":\"A couple of bugs fixed on the varnish accept-language VCL extension - Random hacking\",\"isPartOf\":{\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/#website\"},\"datePublished\":\"2010-05-06T13:38:42+00:00\",\"dateModified\":\"2010-05-06T13:38:42+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/05\/a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/05\/a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/05\/a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.streppone.it\/cosimo\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A couple of bugs fixed on the varnish accept-language VCL extension\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/#website\",\"url\":\"https:\/\/www.streppone.it\/cosimo\/blog\/\",\"name\":\"Random hacking\",\"description\":\"Assume nothing. Code defensively. Keep it simple, stupid!\",\"publisher\":{\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/c443bedbf6ecf99550d6395620801df1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.streppone.it\/cosimo\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/c443bedbf6ecf99550d6395620801df1\",\"name\":\"cosimo\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cb1d938720df45a2720724aae99e3bfc?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cb1d938720df45a2720724aae99e3bfc?s=96&r=g\",\"caption\":\"cosimo\"},\"logo\":{\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/image\/\"},\"url\":\"https:\/\/www.streppone.it\/cosimo\/blog\/author\/cosimo\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"A couple of bugs fixed on the varnish accept-language VCL extension - Random hacking","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/05\/a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension\/","og_locale":"en_US","og_type":"article","og_title":"A couple of bugs fixed on the varnish accept-language VCL extension - Random hacking","og_description":"Today I received a report of a bug in how the Opera.com startup page was presented to some browsers. In particular, people with Brazilian language. This was traced down to being a bug in the accept-language.vcl extension that we are using on both My Opera and Opera.com. In particular, the bug had to do with [&hellip;]","og_url":"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/05\/a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension\/","og_site_name":"Random hacking","article_published_time":"2010-05-06T13:38:42+00:00","author":"cosimo","twitter_card":"summary_large_image","twitter_misc":{"Written by":"cosimo","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/05\/a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension\/#article","isPartOf":{"@id":"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/05\/a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension\/"},"author":{"name":"cosimo","@id":"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/c443bedbf6ecf99550d6395620801df1"},"headline":"A couple of bugs fixed on the varnish accept-language VCL extension","datePublished":"2010-05-06T13:38:42+00:00","dateModified":"2010-05-06T13:38:42+00:00","mainEntityOfPage":{"@id":"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/05\/a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension\/"},"wordCount":180,"commentCount":0,"publisher":{"@id":"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/c443bedbf6ecf99550d6395620801df1"},"keywords":["accept-language","caching","language","myopera","opera.com","varnish","vcl"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.streppone.it\/cosimo\/blog\/2010\/05\/a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/05\/a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension\/","url":"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/05\/a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension\/","name":"A couple of bugs fixed on the varnish accept-language VCL extension - Random hacking","isPartOf":{"@id":"https:\/\/www.streppone.it\/cosimo\/blog\/#website"},"datePublished":"2010-05-06T13:38:42+00:00","dateModified":"2010-05-06T13:38:42+00:00","breadcrumb":{"@id":"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/05\/a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.streppone.it\/cosimo\/blog\/2010\/05\/a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/05\/a-couple-of-bugs-fixed-on-the-varnish-accept-language-vcl-extension\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.streppone.it\/cosimo\/blog\/"},{"@type":"ListItem","position":2,"name":"A couple of bugs fixed on the varnish accept-language VCL extension"}]},{"@type":"WebSite","@id":"https:\/\/www.streppone.it\/cosimo\/blog\/#website","url":"https:\/\/www.streppone.it\/cosimo\/blog\/","name":"Random hacking","description":"Assume nothing. Code defensively. Keep it simple, stupid!","publisher":{"@id":"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/c443bedbf6ecf99550d6395620801df1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.streppone.it\/cosimo\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/c443bedbf6ecf99550d6395620801df1","name":"cosimo","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cb1d938720df45a2720724aae99e3bfc?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cb1d938720df45a2720724aae99e3bfc?s=96&r=g","caption":"cosimo"},"logo":{"@id":"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/image\/"},"url":"https:\/\/www.streppone.it\/cosimo\/blog\/author\/cosimo\/"}]}},"_links":{"self":[{"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/posts\/498"}],"collection":[{"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/comments?post=498"}],"version-history":[{"count":0,"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/posts\/498\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/media?parent=498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/categories?post=498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/tags?post=498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}