You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "bhaveshpun (via GitHub)" <gi...@apache.org> on 2023/02/07 20:15:31 UTC

[GitHub] [trafficserver] bhaveshpun opened a new issue, #9389: Using remap plugins for regex matches in the regex_remap plugin

bhaveshpun opened a new issue, #9389:
URL: https://github.com/apache/trafficserver/issues/9389

   We're currently using ATS v8.1.1. 
   To support regular expressions in request paths, we've been trying to use the regex_remap plugin in the mapping rules 
   
   Our remap rules look like this:
   ```
   map https://example.com/.*.mp4 https://example.com/.*.mp4 @action=allow @method=get \
   @plugin=regex_remap.so @pparam=maps.reg \
   @plugin=url_sig.so @pparam=url_sig.config @pparam=pristineurl \
   @plugin=compress.so @pparam=example.config \
   
   map https://example.com/ https://example.com/ @action=allow @method=post @method=get \
   @plugin=regex_remap.so @pparam=maps.reg \
   ```  
   Rules in the maps.reg file are defined in the following way:
   ```
   ^/.*mp4 $s://$f/$0
   ```
   We would want to use the signed url plugin, the compression plugin and the allowed methods defined in the `.*mp4` mapping rule on requests that match the `.*mp4` regex.
   
   > For example, requests of the type https://example.com/abc.mp4 should be signed and only get method should be allowed for them.
   
   With the current configurations, https://example.com/abc.mp4 matches the second mapping rule. Post method is allowed for such a request, signed urls are not required and compression isn't supported as well.
    
   Is there a way in which we can enable the use of different remap plugins for different regex rules in the maps.reg file ?
   Or is there a simpler workaround for requests to match mapping rules containing regex quantifiers ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficserver.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] zwoop commented on issue #9389: Using remap plugins for regex matches in the regex_remap plugin

Posted by "zwoop (via GitHub)" <gi...@apache.org>.
zwoop commented on issue #9389:
URL: https://github.com/apache/trafficserver/issues/9389#issuecomment-1439264095

   You can't match on regular expressions like that on the path, so in your case, everything matches the second "map" rule. There's also no way to control different plugins to be run based on the path like that either, the regex_map plugin does not support that.
   
   I don't know that there's any solution here which would allow you to run the remap plugins conditionally like this. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Using remap plugins for regex matches in the regex_remap plugin [trafficserver]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #9389:
URL: https://github.com/apache/trafficserver/issues/9389#issuecomment-1958512748

   This issue has been automatically marked as stale because it has not had recent activity. Marking it stale to flag it for further consideration by the community.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org