Request interception does not pass original request headers
Describe the bug Request interception when headers passed as navigation options does not pass on original request headers
Server uses basic http auth and another endpoint requires Accept headers. I passed the Authorization headers for basic auth, future requests were missing the Accept header that should be set automatically by the browser
To Reproduce Created a simple HTTP server with basic auth and verify that Taiko does not receive the Accept header passed by the browser
Expected behavior Taiko should pass on original request headers in addition to the headers passed as navigation options
Versions: Taiko: 1.28
Additional context Was able to get my workflow passing with this patch in the fetch handler:
ubuntu@ip-172-31-17-108:~/relicx$ diff ts/node_modules/taiko/lib/handlers/fetchHandler.js /usr/local/lib/node_modules/taiko/lib/handlers/fetchHandler.js 44a45,48
options.headers = {} for (const headerName in p.request.headers) { options.headers[headerName] = p.request.headers[headerName]; } 47d50 < options.headers = options.headers || {};
Can send a fix for this if this is not the intended behaviour
The patch to pass original parameters makes sense. Please feel free to raise a pull request (and a test to cover this scenario)
@arijit91 could you raise a pr to fix this issue?