Skip to content

Shell - Httpie adds extra https:// for URLs that start with environment variables #330

@CiaranMacCarthaigh

Description

@CiaranMacCarthaigh

Describe the bug
When using a URL that starts with an environment variable, and the environment variable starts with https://, the code generator for Shell - Httpie adds another https:// to the start of the URL.

Example:

Given a request URL {{GoogleUrl}}/doodles, where the enviroment variable for GoogleUrl is https://google.ie, the Shell - Httpie code generator creates http --follow --timeout 3600 GET https://https://google.ie/doodles.

Notes:

  1. This only occurs when using HTTPS. When the environment variable starts with "http://", e.g. http://google.ie, the code generator creates http --follow --timeout 3600 GET http://google.ie/doodles.

  2. For URLs that do not start with environment variables, e.g. https://google.ie/doodles, the code generator creates the correct URL.

To Reproduce
Steps to reproduce the behaviour:

  1. Create an environment in Postman with a variable named GoogleUrl. Set the current value to https://google.ie
  2. Create a GET request with the URL as {{GoogleUrl}}/doodles.
  3. Set the current environment to the one you created before and click on Send. Verify that the request returns 200 OK.
  4. Click on Code and then select "Shell - Httpie" from the list. Note that the code generator has added an extra https:// at the beginning of the URL.

Additional context
Reproducible in Postman v7.31.1. At time of writing, this was the latest version.

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