[squid-users] ECAP: How to Add header to get request
Ivan Kolesnikov
ivan.kolesnikov.fkn at gmail.com
Thu Mar 30 08:37:28 UTC 2017
Hi Everyone,
I need add a Cookie header for some get requests via SQUID.
I can add: 'request_header_add Cookie "My_cookie_value" all' in squid.conf,
but in this case Cookie header will be add for all requests and I can't
manipulate with my "My_cookie_value". I updated adapter_modifying.cc and
add the following code in Adapter::Xaction::start() function:
static const libecap::Name name_cookie("Cookie");
const libecap::Header::Value value_cookie =
libecap::Area::FromTempString("video_key=My_cookie_value");
adapted->header().add(name_cookie, value_cookie);
In that case Cookie header was add in all responses.
Please see my squid.conf:
loadable_modules /usr/local/lib/ecap/ecap_adapter_modifying.so
ecap_enable on
ecap_service ecapModifier respmod_precache \
uri=ecap://e-cap.org/ecap/services/sample/modifying \
victim=awerewrewrewrwerefbfcvglkflds9349rdsgfdk9dfgkj95tfnvxcncbnbv
\
replacement=$$$$$$$
adaptation_access ecapModifier allow all
Please advice how to correctly add header in get requests?
Best Regards,
Ivan Kolesnikov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-users/attachments/20170330/cdea44ba/attachment.html>
More information about the squid-users
mailing list