Open lalyos opened 11 months ago
With this change not only query params but the headers are also available in templated html response.
There are at least 2 use cases which would be covered:
$ BASKET=getuser $ URL=https://rbaskets.in $ T=$(curl -s ${URL}/api/baskets/${BASKET} -d '' | jq .token -r ) $ curl -X PUT -H "Authorization: $T" ${URL}/api/baskets/${BASKET}/responses/GET \ -d '{"status":200,"headers":{},"body":"user: {{ index .headers \"X-Forwarded-Preferred-Username\" }}\nemail: {{ index .headers \"X-Forwarded-Email\" }}","is_template":true}' ## test $ curl -H "X-Forwarded-Preferred-Username: fake" -H "X-Forwarded-Email: fake@ema.il" ${URL}/${BASKET} user: [fake] email: [fake@ema.il]
With this change not only query params but the headers are also available in templated html response.
There are at least 2 use cases which would be covered: