F5Networks / f5-ansible

Imperative Ansible modules for F5 BIG-IP products
GNU General Public License v3.0
376 stars 231 forks source link

bigip_policy_rule escapes special characters in urls for action->redirect->location #2248

Open anderpups opened 2 years ago

anderpups commented 2 years ago
COMPONENT NAME

f5networks.f5_modules.bigip_policy_rule:

Environment

ANSIBLE VERSION
ansible-playbook [core 2.12.6]
  config file = /home/odtebja/.ansible.cfg
  configured module search path = ['/home/odtebja/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/odtebja/.local/lib/python3.8/site-packages/ansible
  ansible collection location = /home/odtebja/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/odtebja/.local/bin/ansible-playbook
  python version = 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True
BIGIP VERSION
Sys::Version
Main Package
  Product     BIG-IP
  Version     16.1.3
  Build       0.0.12
  Edition     Final
  Date        Tue Jun  7 19:57:05 PDT 2022
CONFIGURATION
OS / ENVIRONMENT

Ubuntu 20.04

SUMMARY
STEPS TO REPRODUCE
- name: create ltm policy rule
  f5networks.f5_modules.bigip_policy_rule:
    name: foo_ltm_rule
    policy: foo_ltm_policy
    conditions:
      - type: http_host
        host_is_any:
          - foo.bar.com
      - type: http_uri
    actions:
      - type: redirect
        location: https://www.foobar.com/index.shtml?key=value
EXPECTED RESULTS

This is what the Action should look like in the LTM policy rule

Redirect to location 'https://www.foobar.com/index.shtml?key=value' at request time.
ACTUAL RESULTS

Below is copied from ltm policy rule created. Notice the backslash before the question mark.

Redirect to location 'https://www.foobar.com/index.shtml\?key=value' at request time.
NOTE

It seems the F5 strips those backslashes when the actual request goes through so not a critical issue, but sure is ugly.

HTTP/1.0 302 Moved Temporarily
Location: https://www.foobar.com/index.shtml?key=value
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
KrithikaChidambaram commented 1 year ago

Hi, is the configuration working? Is it just a cosmetic issue?

anderpups commented 1 year ago

Hello - It is just a cosmetic issue, it doesn't seem to change the behavior of the redirect. Thanks