ansibleguy76 / ansibleforms

A webapplication to create pretty advanced forms to run ansible playbooks or awx templates.
https://ansibleforms.com/
GNU General Public License v3.0
66 stars 10 forks source link

Using application/x-www-form-urlencoded in headers and body of RestAdvanced doesnt work #177

Closed nikos445 closed 3 months ago

nikos445 commented 3 months ago

Describe the bug Using application/x-www-form-urlencoded in headers and body doesn't encode in URL format the body or headers

To Reproduce

expression: fn.fnRestAdvanced( 'post', $(test.host)/login', 'username=$(test.user)&password=$(test.password)&client_id=$(test.user)&client_secret=$(test.password)', {'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8'}, '.access_token', '')

Expected behavior URL encode the user that has domain\username URL encode the password that has symbols %^'/*!&#\ etc...

Screenshots N/A

Version ansibleforms v5.0.1

Deployment Deployed ansibleforms with :

Additional context Add any other context about the problem here.

ansibleguy76 commented 3 months ago

hi

if you want to have the headers encoded in a specific way, you should encode them yourself. make a hidden intermediate expression and encode as you wish (runLocal true will allow the full javascript engine) and then use the outcome of that intermediate field in your custom headers.

nikos445 commented 3 months ago

Oki but I think that as long as you specify this header (application/x-www-form-urlencoded) it shall be done automatically...