-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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: Ensure basic auth headers are set on extra target requests #28387
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const authCreds = { | ||
username: 'cypress', | ||
password: 'password123', | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,7 @@ const ExtractCypressMetadataHeaders: RequestMiddleware = function () { | |
delete this.req.headers['x-cypress-is-from-extra-target'] | ||
|
||
this.onlyRunMiddleware([ | ||
'MaybeSetBasicAuthHeaders', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we really want to attach basic auth to all requests in the new target? The download use-case seems like the exception not the default. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we would only attach if the origins match, correct? So, that's probably fine. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, they have to |
||
'SendRequestOutgoing', | ||
]) | ||
} | ||
|
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.
can this assert that a new window was opened successfully rather than skipping it in webkit?
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.
Having a new window open isn't the desired behavior, so I would hesitate to codify that behavior. It's supposed to download the file, but it seems that doesn't work in webkit for some reason. Might be something we fix in the future, but I'd say it's out of scope for this bug fix.