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
fix: session referer rewritten in iframe tasks #2813
Conversation
a39c8c3
to
a135ca7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR. You will need to refactor it a bit.
src/proxy/index.ts
Outdated
@@ -211,7 +211,7 @@ export default class Proxy extends Router { | |||
const windowId = refererDest && refererDest.windowId || void 0; | |||
|
|||
if (session) { | |||
session.options.referer = referer || session.options.referer; | |||
if (!isIframe) session.options.referer = referer || session.options.referer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest you do this as follows:
if (!isIframe) session.options.referer = referer || session.options.referer; | |
if (!isIframe && referer) | |
session.options.referer = referer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, thanks
a135ca7
to
c11b335
Compare
Applied the suggestion. Thank you for the prompt response! |
Closes DevExpress/testcafe#7376
Purpose
This partially undoes 55209a5 so that the session referer option does not get rewritten by iframe tasks.
Approach
I simply added the condition before this rewrite happens, but I am not familiar enough with the codebase nor proxies in general to fully justify the change.
Let me know if it makes sense as well as the test. I can close it otherwise.
References
DevExpress/testcafe#7376
Pre-Merge TODO