AnWeber / vscode-httpyac

Quickly and easily send REST, Soap, GraphQL, GRPC, MQTT and WebSocket requests directly within Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=anweber.vscode-httpyac
MIT License
237 stars 20 forks source link

@no-redirect directive does not seem to be honoured #171

Closed myfonj closed 1 year ago

myfonj commented 1 year ago

Doing the # @no-redirect sample call from the guide

# @no-redirect

GET https://httpbin.org/absolute-redirect/2

For me displays only the final exchange:

GET http://httpbin.org/get
accept-encoding: gzip, deflate, br
accept: */*
user-agent: httpyac

HTTP/1.1 200 OK
access-control-allow-credentials: true
access-control-allow-origin: *
connection: close
content-length: 313
content-type: application/json
date: Wed, 01 Feb 2023 09:34:08 GMT
server: gunicorn/19.9.0

[...]

Doing CURL shows it actually goes through two 302:

curl --location --head --silent https://httpbin.org/absolute-redirect/2 | grep --extended-regexp --ignore-case "^(HTTP|Location|$)"
HTTP/1.1 200 Connection established

HTTP/1.1 302 FOUND
Location: http://httpbin.org/absolute-redirect/1

HTTP/1.1 302 FOUND
Location: http://httpbin.org/get

HTTP/1.1 200 OK

So I'd expect to see not the final exchange with

HTTP/1.1 200 OK
content-length: 313

but the first response with

HTTP/1.1 302 FOUND
Location: http://httpbin.org/absolute-redirect/1

in VSCode HTTPYac.

Am I correct or is there something else to set to see the first "redirecting" response?

AnWeber commented 1 year ago

A bug has crept in during refactoring. I have fixed it and added a test for it. thx. Will be fixed with next release.