Skip to content
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

core: added capability to pass cookies as CLI parameter #9162

Closed
wants to merge 3,181 commits into from
Closed

core: added capability to pass cookies as CLI parameter #9162

wants to merge 3,181 commits into from

Conversation

RynatSibahatau
Copy link

Summary

This feature adds the capability to pass cookies as a CLI parameter.

The current proposed approach to use "--extra-headers" parameter for setting cookies has a drawback for a wide range of enterprise applications that operates with the cookies (ex. authentication, localization, etc.).
Any Set-Cookie response from backend overwrites the Cookie header from extra-headers.
It introduces extra complexity of using lighthouse on CI in pure CLI mode (i.e without Puppeteer).
The fix intended to remove this complexity.

  • lighthouse http://localhost/ --extra-headers "{\"Cookie\":\"test=true\"}"
    Request header: Cookie: test=true
    Response header: Set-Cookie: locale=en;

  • All subsequent requests headers:
    Actual request headers : Cookie: locale=en
    Expected request headers: Cookie: test=true; locale=en

After merging this PR the following command introduced expected behaviour for cookies:

lighthouse http://localhost/ --extra-cookies "[{\"name\":\"test\", \"value\": \"true\", \"url\": \"http://localhost\"}]"

Links:
#6207 (comment)

Related Issues/PRs

#6207

connorjclark and others added 30 commits March 14, 2019 15:23
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@RynatSibahatau RynatSibahatau changed the title cli/core: added capability to pass cookies as CLI parameter core: added capability to pass cookies as CLI parameter Jun 10, 2019
@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

ℹ️ Googlers: Go here for more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.