Skip to content

Fix HTTP endpoint variable resolution when value contains leading slash #108

Description

@VadymKostenkoTestlum

Problem

When using variables inside HTTP endpoint attributes, the behavior is inconsistent depending on whether the variable value contains a leading slash (/).

Current behavior

This works:

<var name="resourceEndpoint">
    <constant value="api/test/auth/jwt/resource"/>
</var>

<http alias="MEGA_APP">
    <get endpoint="/{{resourceEndpoint}}">
        <response code="200"/>
    </get>
</http>

But this more natural form does not work as expected:

<var name="resourceEndpoint">
    <constant value="/api/test/auth/jwt/resource"/>
</var>

<http alias="MEGA_APP">
    <get endpoint="{{resourceEndpoint}}">
        <response code="200"/>
    </get>
</http>

Expected: both "/{{var}}" and "{{var}}" should work the same way regardless of whether the variable value starts with "/".

Suggestion: normalize endpoint handling during variable substitution.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions