<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Reference on WebP Server Documentation</title><link>https://docs.webp.sh/reference/</link><description>Recent content in Reference on WebP Server Documentation</description><generator>Hugo</generator><language>en</language><atom:link href="https://docs.webp.sh/reference/index.xml" rel="self" type="application/rss+xml"/><item><title>Headers</title><link>https://docs.webp.sh/reference/headers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://docs.webp.sh/reference/headers/</guid><description>&lt;h1 id="headers"&gt;
 Headers
 &lt;a class="anchor" href="#headers"&gt;#&lt;/a&gt;
&lt;/h1&gt;
&lt;p&gt;WebP Server Go will render the following header in response:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;etag&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Example: &lt;code&gt;W/&amp;quot;87328-49BF2BCE&amp;quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;This header is produced by &lt;code&gt;W/&amp;quot;&amp;lt;content length&amp;gt;-&amp;lt;CRC Checksum of the file&amp;gt;&amp;quot;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;x-compression-rate&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Example: &lt;code&gt;0.87&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;This header is produced by &lt;code&gt;size(webp_image)/size(original_image)&lt;/code&gt;, if the value is bigger than 1, it means the converted webp image is bigger than the original image, hence the original image is return to the visitor.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Extra Parameters</title><link>https://docs.webp.sh/reference/extra-params/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://docs.webp.sh/reference/extra-params/</guid><description>&lt;h1 id="extra-parameters"&gt;
 Extra Parameters
 &lt;a class="anchor" href="#extra-parameters"&gt;#&lt;/a&gt;
&lt;/h1&gt;
&lt;p&gt;You can turn it on by setting &lt;code&gt;&amp;quot;ENABLE_EXTRA_PARAMS&amp;quot;: true&lt;/code&gt; in &lt;code&gt;config.json&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Currently, we support the following params:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;height&lt;/li&gt;
&lt;li&gt;width&lt;/li&gt;
&lt;li&gt;max_width&lt;/li&gt;
&lt;li&gt;max_height&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;both are in px.&lt;/p&gt;
&lt;h2 id="example-on-height-and-width"&gt;
 Example on &lt;code&gt;height&lt;/code&gt; and &lt;code&gt;width&lt;/code&gt;
 &lt;a class="anchor" href="#example-on-height-and-width"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;div class="book-columns flex flex-wrap"&gt;

 &lt;div class="flex-even markdown-inner"&gt;
 &lt;img src="https://docs.webp.sh/images/nasa.jpg"/&gt;
&lt;p&gt;&lt;code&gt;http://some-host.tld/path/to/nasa.jpg&lt;/code&gt;&lt;/p&gt;
 &lt;/div&gt;

 &lt;div class="flex-even markdown-inner"&gt;
 &lt;img src="https://docs.webp.sh/images/nasa-200.jpg"/&gt;
&lt;p&gt;&lt;code&gt;http://some-host.tld/path/to/nasa.jpg?width=200&lt;/code&gt;&lt;/p&gt;
 &lt;/div&gt;

&lt;/div&gt;

&lt;p&gt;If you set both &lt;code&gt;width&lt;/code&gt; and &lt;code&gt;height&lt;/code&gt;, your image will be cropped using attention crop by default maintain your width-height ratio, like this:&lt;/p&gt;
&lt;div class="book-columns flex flex-wrap"&gt;

 &lt;div class="flex-even markdown-inner"&gt;
 &lt;img src="https://docs.webp.sh/images/origin.png"/&gt;
&lt;p&gt;&lt;code&gt;http://some-host.tld/path/to/origin.png&lt;/code&gt;&lt;/p&gt;
 &lt;/div&gt;

 &lt;div class="flex-even markdown-inner"&gt;
 &lt;img src="https://docs.webp.sh/images/attention_800.png"/&gt;
&lt;p&gt;&lt;code&gt;http://some-host.tld/path/to/origin.png?width=400&amp;amp;height=800&lt;/code&gt;&lt;/p&gt;</description></item><item><title>Query Parameters</title><link>https://docs.webp.sh/reference/query-parameters/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://docs.webp.sh/reference/query-parameters/</guid><description>&lt;h1 id="query-parameters"&gt;
 Query Parameters
 &lt;a class="anchor" href="#query-parameters"&gt;#&lt;/a&gt;
&lt;/h1&gt;
&lt;p&gt;Besides 
 &lt;a href="https://docs.webp.sh/reference/extra-params/"&gt;Extra Parameters&lt;/a&gt; (&lt;code&gt;width&lt;/code&gt;, &lt;code&gt;height&lt;/code&gt;, and related options), WebP Server Go supports metadata query parameters on image requests.&lt;/p&gt;
&lt;h2 id="metafull"&gt;
 &lt;code&gt;meta=full&lt;/code&gt;
 &lt;a class="anchor" href="#metafull"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Request full metadata for a resource as JSON:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;GET /path/to/image.jpg?meta=full
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Behavior:&lt;/p&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Condition&lt;/th&gt;
 &lt;th&gt;HTTP status&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;Valid path and source exists (local file or reachable remote)&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;200&lt;/code&gt; with JSON body&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Malformed or illegal path&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;404 Not Found&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Valid path but source does not exist&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;404 Not Found&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Previously, &lt;code&gt;meta=full&lt;/code&gt; could return metadata from cache even when the source file was missing or the path was invalid. Current versions validate the path and confirm the source exists &lt;strong&gt;before&lt;/strong&gt; returning metadata.&lt;/p&gt;</description></item><item><title>Security</title><link>https://docs.webp.sh/reference/security/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://docs.webp.sh/reference/security/</guid><description>&lt;h1 id="security"&gt;
 Security
 &lt;a class="anchor" href="#security"&gt;#&lt;/a&gt;
&lt;/h1&gt;
&lt;p&gt;WebP Server Go applies path validation before reading local files or resolving remote URLs. Invalid, malformed, or traversal attempts are handled consistently.&lt;/p&gt;
&lt;h2 id="path-traversal-protection"&gt;
 Path traversal protection
 &lt;a class="anchor" href="#path-traversal-protection"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;The server rejects directory traversal in request paths, including encoded variants:&lt;/p&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Attack pattern&lt;/th&gt;
 &lt;th&gt;Example&lt;/th&gt;
 &lt;th&gt;Result&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;Plain traversal&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;/../etc/passwd&lt;/code&gt;, &lt;code&gt;..%2f&lt;/code&gt; in path segments&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;404 Not Found&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Single URL encoding&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;%2e%2e%2f&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;404 Not Found&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Double URL encoding&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;%252e%252e%252f&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;404 Not Found&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Paths are decoded before segment checks so nested encodings cannot bypass validation.&lt;/p&gt;</description></item></channel></rss>