Skip to content

httpresponse HX-Redired injects extraneous spaces when lava used #22

Description

@stevelipinski

Description

When lava (e.g., {{ param }}) is included in httpresponse HX-Redirect header, extraneous spaces end up in the redirect path/header that result in %20s in the URL causing a redirect failure.

Given the following:

{% assign param='ABCD' %}
{% httpresponse %}
        [[ header key:'HX-Redirect' ]]/Entry/{{ param }}?New=True[[ endheader ]]
{% endhttpresponse %}

Actual Behavior

Attempts to redirect to:
/Entry/%20ABCD%20?New=True

Expected Behavior

Redirect to:
/Entry/ABCD?New=True

Steps to Reproduce

{% assign param='ABCD' %}
{% httpresponse %}
        [[ header key:'HX-Redirect' ]]/Entry/{{ param }}?New=True[[ endheader ]]
{% endhttpresponse %}

Note, the following workaround avoids this issue:

{% assign param='ABCD' %}
{% httpresponse %}
        [[ header key:'HX-Redirect' ]]{{ param | Prepend:'/Entry/' | Append:'?New=True' }}[[ endheader ]]
{% endhttpresponse %}

Issue Confirmation

  • Perform a search on the Github Issues to see if your bug or enhancement is already reported.
  • Try to reproduce the problem on a fresh install or on the demo site.

Rock Version

16.10

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions