-
-
Notifications
You must be signed in to change notification settings - Fork 413
Extra Spaces Returned in Value From HttpResponse Command #6869
Copy link
Copy link
Closed
Labels
Fixed in v19.2Status: ConfirmedIt's clear what the subject of the issue is about, and what the resolution should be.It's clear what the subject of the issue is about, and what the resolution should be.Topic: LavaRelated to the Lava templating language.Related to the Lava templating language.Type: BugConfirmed bugs or reports that are very likely to be bugs.Confirmed bugs or reports that are very likely to be bugs.
Metadata
Metadata
Assignees
Labels
Fixed in v19.2Status: ConfirmedIt's clear what the subject of the issue is about, and what the resolution should be.It's clear what the subject of the issue is about, and what the resolution should be.Topic: LavaRelated to the Lava templating language.Related to the Lava templating language.Type: BugConfirmed bugs or reports that are very likely to be bugs.Confirmed bugs or reports that are very likely to be bugs.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Description
If a merge field is used together with a string literal in a
{% httpresponse %}[[ header ]]value, it causes one or more extra space characters to be returned, which breaks the intended functionality.We had a language model analyze the code and it indicated that the issue is likely in Rock/Lava/Blocks/HttpResponse.cs:53 because it’s splitting the string every
{{ }}/{% %}boundary, and then joining them back with a space between them. Later, Rock/Lava/Blocks/HttpResponse.cs:181 is running.Trim()but that only removes the extra spaces at the beginning and end of the string, not the extra spaces between the pieces.Other commands like {% observe %} appear to do the join using
string.Emptyinstead of a space.The example we were using when we encountered this issue was:
Actual Behavior
The above template returns
/groups/search?campus=%20abc12345(note the %20 which is an encoded space after the equals sign – that shouldn’t be there).Expected Behavior
The template should return
/groups/search?campus=abc12345instead, with no space after the =Steps to Reproduce
Issue Confirmation
Rock Version
At least v18.1 through prealpha 20.0.3
Client Culture Setting
en-US