Modifying Adapter: unsupported parameter: src

Asked by Denis

Hello.
I'm trying to modify html, here is my Squid 3.2.1 (eCAP 0.2.0) code:

loadable_modules /usr/local/lib/ecap_adapter_modifying.so /usr/local/lib/ecap_adapter_minimal.so
ecap_enable on

ecap_service eReqmod reqmod_precache 0 victim="<body>" ecap://e-cap.org/ecap/services/sample/modifying
ecap_service eRespmod respmod_precache 0 replacement="<body><img src="http://limg.imgsmail.ru/s/images/logo/logo.v2.png">" ecap://e-cap.org/ecap/services/sample/modifying

adaptation_service_set reqFilter eReqmod
adaptation_service_set respFilter eRespmod
adaptation_access reqFilter allow localnet
adaptation_access respFilter allow localnet

And i have error, squid is down:
ERROR: failed to start essential eCAP service: ecap://e-cap.org/ecap/services/sample/modifying:#012Modifying Adapter: configuration error: unsupported configuration parameter: src
FATAL: dying from an unhandled exception: Modifying Adapter: configuration error: unsupported configuration parameter: src

How I can modify html, to insert img?
What kind of code I can insert? I can't insert some JS-script?

Thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
eCAP Edit question
Assignee:
No assignee Edit question
Solved by:
Alex Rousskov
Solved:
Last query:
Last reply:
Revision history for this message
Denis (dsolomennikov) said :
#1

I was wrong, right string to modify is:

ecap_service eRespmod respmod_precache 0 victim=<body> replacement=bla-bla ecap://e-cap.org/ecap/services/sample/modifying

But, ecap don't understood src...

Revision history for this message
Best Alex Rousskov (rousskov) said :
#2

This is a Squid configuration question, not eCAP question. Please direct future Squid configuration questions to the Squid Project.

Most Squid directives, including ecap_service, cannot handle spaces in option values. You cannot configure a replacement text that uses spaces.

The sample modifying adapter is not meant for production use. It disregards content structure and can only substitute basic strings. Depending on their purpose, production-quality adapters can modify HTML (or other content types) and can inject Javascript (or other components). A production-quality adapter may accept a file name to load the replacement text from (or even a stand-alone adapter configuration file).

Revision history for this message
Denis (dsolomennikov) said :
#3

Thanks Alex Rousskov, that solved my question.