Obtaining the input in text fields, page construction and rejection

Asked by Lucian Bazoi on 2010-12-08


   I need all the texts a user enters in text fields and text areas in a web page in a request after being submitted and before it is processed by the server. Can I get this using eCAP? Can I get the GET and POST messages using eCAP?
   Another question is how do I reconstruct the web pages? How do I know when a new web page begins and when the page ends so that I can analyze the text entered in it? I only need the text entered in text fields and areas.

  If something bad is entered I need to reject that request. How do I do that?

   How can I create an adapter to do this analysis job? Do I start from adapter_minimal, from adapter_passthru.cc or from adapter_modifying.cc

Thank you very much.

Question information

English Edit question
eCAP Edit question
No assignee Edit question
Last query:
Last reply:
Alex Rousskov (rousskov) said : #1

Please consider asking one question per Question so that it is easier for others to find information.

eCAP, just like ICAP (RFC 3507) gives you access to HTTP messages and alike, including GET/POST requests and responses. I believe it provides you with access to the HTML form submission information you need.

HTTP does not have a concept of a "web page". While it is possible to associate individual HTTP transactions with "pages" using various heuristics (e.g., Referer header and embedded links), there is no simple or reliable way to do that. However, a single HTTP request should contain all the fields in the corresponding HTML form (there could be many forms on the page though). If you only care about individual form submissions, then you may be able to work with individual GET, POST, and perhaps PUT requests, ignoring the issue of "web pages".

To "reject" a request, you need to return an HTTP response message as the adapted message (see the useAdapted method). This is called "request satisfaction". The next libecap release will have a method to create an HTTP response from scratch. Such method is necessary in REQMOD context because there is no virgin response message you can clone() and modify.

I am not sure which sample adapter would be best for your needs as it depends on your development style and preferences. Modifying Adapter implements the most hooks, but Passthru Adapter does not have content modification logic which you do not need.

Can you help with this problem?

Provide an answer of your own, or ask Lucian Bazoi for more information if necessary.

To post a message you must log in.