Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Jul 28, 2017

This change introduces support for URL encoded requests, fixes #1 . Ended up not needing to split out into ACLs and have kept the format originally used.

http-request deny if { path,url_dec -m reg -i ^(/v[\d\.]+)?/system } ! { env(SYSTEM) -m bool }
http-request deny if { path,url_dec -m reg -i ^(/v[\d\.]+)?/tasks } ! { env(TASKS) -m bool }
http-request deny if { path,url_dec -m reg -i ^(/v[\d\.]+)?/version } ! { env(VERSION) -m bool }
http-request deny if { path,url_dec -m reg -i ^(/v[\d\.]+)?/volumes } ! { env(VOLUMES) -m bool }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't all this be path_reg,url_dec instead?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yajo I had tried it with path_reg,url_dec but couldn't get it to work - everything would still get through. I think it works with the match modifiers due to the way the patters are parsed. I think in this case, fetch the path, run through url_dec and then apply regex match against the result.

@yajo yajo merged commit 6c6ad0a into Tecnativa:master Jul 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Does not prevent URL encoded API interaction

1 participant