Commit 278460f3 authored by Geoff Simmons's avatar Geoff Simmons

Add the decoder_version() function.

parent f72cbbdf
...@@ -58,7 +58,10 @@ Example:: ...@@ -58,7 +58,10 @@ Example::
std.log("Using brotli encoder version: " + brotli.encoder_version()); std.log("Using brotli encoder version: " + brotli.encoder_version());
#$Function STRING decoder_version() .. _vmod_brotli.decoder_version:
STRING decoder_version()
------------------------
Return the version string for the brotli decoder. Return the version string for the brotli decoder.
......
...@@ -37,6 +37,10 @@ varnish v1 -vcl { ...@@ -37,6 +37,10 @@ varnish v1 -vcl {
if (!resp.http.x-encoder-version) { if (!resp.http.x-encoder-version) {
set resp.status = 500; set resp.status = 500;
} }
set resp.http.x-decoder-version = brotli.decoder_version();
if (!resp.http.x-decoder-version) {
set resp.status = 500;
}
return(deliver); return(deliver);
} }
} }
...@@ -47,4 +51,5 @@ client c1 { ...@@ -47,4 +51,5 @@ client c1 {
expect resp.status == 200 expect resp.status == 200
expect resp.http.x-version ~ "^.+$" expect resp.http.x-version ~ "^.+$"
expect resp.http.x-encoder-version ~ {^\d+\.\d+\.\d+$} expect resp.http.x-encoder-version ~ {^\d+\.\d+\.\d+$}
expect resp.http.x-decoder-version ~ {^\d+\.\d+\.\d+$}
} -run } -run
...@@ -443,13 +443,11 @@ vmod_encoder_version(VRT_CTX) ...@@ -443,13 +443,11 @@ vmod_encoder_version(VRT_CTX)
return (brotli_version(ctx, BrotliEncoderVersion())); return (brotli_version(ctx, BrotliEncoderVersion()));
} }
#if 0
VCL_STRING VCL_STRING
vmod_decoder_version(VRT_CTX) vmod_decoder_version(VRT_CTX)
{ {
return (brotli_version(ctx, BrotliDecoderVersion())); return (brotli_version(ctx, BrotliDecoderVersion()));
} }
#endif
VCL_STRING VCL_STRING
vmod_version(VRT_CTX) vmod_version(VRT_CTX)
......
...@@ -51,7 +51,7 @@ Example:: ...@@ -51,7 +51,7 @@ Example::
std.log("Using brotli encoder version: " + brotli.encoder_version()); std.log("Using brotli encoder version: " + brotli.encoder_version());
#$Function STRING decoder_version() $Function STRING decoder_version()
Return the version string for the brotli decoder. Return the version string for the brotli decoder.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment