Skip to content

Using replace filter inside a custom module #11

@divya84

Description

@divya84

Hi,

This is not really an issue; more of a question about your code.
I am building a custom module that needs to filter some parts of the response based on request cookies and the regex used depends on the cookie value. I am trying to use your code within my module for the regex based replacement but get rid of the configuration directives and set the regex and replacement string myself. But from looking at the code I am not exactly sure where the regex and replacement strings are being set. My first intuition is:

a) You are setting the value of the regex inside ngx_http_replace_filter_module.c:699
*re = value[1].data;
b) You are setting the value of the replacement string inside ngx_http_replace_filter_module.c:710
ccv.value = &value[2];

Is this correct? I tried to run a simple test by hardcoding these two values but the replacement does not happen. Any clarification regarding this will be appreciated.

Thanks :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions