Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hoverfly ignores scheme when matching HTTP requests #959

Open
veliakiner opened this issue Jan 23, 2021 · 1 comment
Open

Hoverfly ignores scheme when matching HTTP requests #959

veliakiner opened this issue Jan 23, 2021 · 1 comment

Comments

@veliakiner
Copy link

veliakiner commented Jan 23, 2021

Description of the bug

When making HTTP requests via Hoverfly, it will ignore the scheme. I have a Python test which makes a request to "http://google.com" using the requests library, with Hoverfly set as the proxy. Before making the request, I load a JSON file containing one request-response pair, which has a scheme field set to https.

The response contains a custom Hoverfly-Cache-Served header which is absent from the response sent from google.com, allowing me to differentiate between a real and fake response.

Observed result

The response contains custom header, indicating that the request was matched (when it shouldn't).

Expected result

The response should not contain the custom header.

Additional relevant information

Hoverfly version: 1.3.1

Reproduced on OSX Mojave and Ubuntu 16 LTS.

I've set the scheme in the simulation to other things as well, and can confirm it's ignored each time.

Although the test cases uses the requests library, this is purely for easy reproduction. I originally saw this bug in a request made by Google Chrome, with Hoverfly set as an HTTP proxy.

I have a test case to reproduce the bug on the bug branch of https://github.com/kopernio/pytest-hoverfly-wrapper. To run, create a new Python virtual environment, run pip install -r requirements.txt, and ensure that the Hoverfly executable is in your PATH. Then run the test:
pytest tests/test_hoverfly_wrapper.py::test_1

@ns3777k
Copy link
Contributor

ns3777k commented Jan 23, 2021

duplicate i suppose #575

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants