postmanlabs / postman-app-support

Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.
https://www.postman.com
5.85k stars 841 forks source link

Response matching not working for header Authorization in mock server #13209

Open progra-4-2024 opened 1 month ago

progra-4-2024 commented 1 month ago

Is there an existing issue for this?

Describe the Issue

I have a mock server with url https://c99ba268-b8e6-4eae-9efe-15148626b379.mock.pstmn.io I added 2 ursl, /marcas/1 and /marcas/2 at creation time. Next I added in both the default and the request itself of the created mock the Request Header Authorization: Bearer 123ASDF Next I selected the mock, click on Edit Configuration and on the bottom Response Matching, enabled headers and added Authorization. When I open the url in chrome https://c99ba268-b8e6-4eae-9efe-15148626b379.mock.pstmn.io/marcas/1 it should throw and error because no Authorization header is being sent. I also tried the default being an error and the only example with Authorization being a good response. that didn't work either.

Steps To Reproduce

1.- create a mock server 2.- add url with response. 3.- save mock server 4.- open configuration of mock server, add match response with header "Authorization", and save (Also tried with the Bearer) 5.- add different example response with a header Authorization in the newly created collection and request. 6.- Try calling the same url with and without the header Authorization: Bearer 123ASDF. Expected result: different responses should be returned. Observed result: both requests return the same value

Screenshots or Videos

No response

Operating System

Windows

Postman Version

v11.16

Postman Platform

Postman App

User Account Type

Signed In User

Additional Context?

No response