Send blobs as synthetic bodies from Varnish VCL
Before that, when building from a system without Git some Makefile steps would fail because without it vmodtool.py would not generate the required src/vmod_vcs_version.txt file to be present. We now check if the file is already present or if git is installed, if either condition is validated then src/vmod_vcs_version.txt will be used, if not it will not be used and a warning will be issued at configure time. |
||
|---|---|---|
| src | ||
| .clang-tidy | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| .travis.yml | ||
| bootstrap | ||
| CHANGES.rst | ||
| configure.ac | ||
| COPYING | ||
| INSTALL.rst | ||
| LICENSE | ||
| Makefile.am | ||
| README.rst | ||
..
.. NB: This file is machine generated, DO NOT EDIT!
..
.. Edit ./vmod_blobsynth.vcc and run make instead
..
.. role:: ref(emphasis)
==============
vmod_blobsynth
==============
--------------------------
Binary Synthetic Responses
--------------------------
:Manual section: 3
SYNOPSIS
========
.. parsed-literal::
import blobsynth [as name] [from "path"]
VOID synthetic(BLOB blob)
DESCRIPTION
===========
Trivial vmod to use blobs for synthetic responses, intended only as a
transitional solution until support for generating synthetic responses
is generalised in Varnish Cache.
Example::
import blob;
import blobsynth;
sub vcl_init {
new gif = blob.blob(BASE64,
"R0lGODlhAQABAPAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==");
}
sub vcl_synth {
set resp.http.Content-Type = "image/gif";
blobsynth.synthetic(gif.get());
return (deliver);
}
.. _blobsynth.synthetic():
VOID synthetic(BLOB blob)
-------------------------
Create a synthetic response from *blob*, equivalent to the
``synthetic()`` built-in function except for the argument type.
Restricted to: ``vcl_synth``, ``vcl_backend_error``.
COPYRIGHT
=========
::
This is free and unencumbered software released into the public domain.
See the LICENSE file contained in the source repository / distribution