bbyars / mountebank

Over the wire test doubles
http://www.mbtest.org
MIT License
2k stars 262 forks source link

Expect field in the header #716

Open dolgydmitry opened 1 year ago

dolgydmitry commented 1 year ago

Hi

I try to create imposter for request with use Expect field in the headers The sample: headers in real request: {'Authorization': 'Bearer ' + self.auth_token, 'Expect': '202-accepted'} My predicate: "predicates": [{ "equals": { "method": "POST", "path": "/eso-manager/api/activation/service" } } ]

Mountebank send error 417 for this request. How I can fix it

OS : linux mountebank :

bbyars commented 1 year ago

Hi there, It looks like we need to listen to the checkExpectation event https://nodejs.org/api/http.html#event-checkexpectation to prevent the 417, which would be a code change in mountebank. I'm admittedly well behind on some mountebank work but will add this to the backlog (PR welcome!). -Brandon

On Tue, Dec 27, 2022 at 11:56 AM dolgydmitry @.***> wrote:

Hi

I try to create imposter for request with use Expect field in the headers The sample: headers in real request: {'Authorization': 'Bearer ' + self.auth_token, 'Expect': '202-accepted'} My predicate: "predicates": [{ "equals": { "method": "POST", "path": "/eso-manager/api/activation/service" } } ]

Mountebank send error 417 for this request. How I can fix it

OS : linux mountebank :

— Reply to this email directly, view it on GitHub https://github.com/bbyars/mountebank/issues/716, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAARFP6FPIW6WQXR3BE5LQ3WPMUUBANCNFSM6AAAAAATKTNR34 . You are receiving this because you are subscribed to this thread.Message ID: @.***>