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

Add Header #59

Open
danwfreeman opened this issue Nov 5, 2015 · 9 comments
Open

Add Header #59

danwfreeman opened this issue Nov 5, 2015 · 9 comments

Comments

@danwfreeman
Copy link

When using the WPT web UI the addHeader method works great.

When using the node wrapper program I cannot get it to work.

This is the syntax I use in the WPT UI which works:
addHeader X-header: someheader
navigate https://some.url.com

In the node program it looks like this:

var script = wpt.scriptToString([
{addHeader:[‘X-Header:’, ‘someheader’]},
{navigate: "https://some.url.com"}
])

wpt.runTest(script, {"location": "us-west-2", "connectivity": "Cable"}, function(err, data) {
...
});

The headers do not show up in the requests when viewing the results on the WPT web UI

Is this disabled from the wrapper program, how can I get it to work?

Thanks,
Dan

@7Ds7
Copy link

7Ds7 commented Apr 6, 2016

Kind of have the same problem with the setCookie i can confirm the test runs as a scripted test but besides the fact that it takes forever to run the test, it does also discard the header/cookie information

var script = wpt.scriptToString([
  {setCookie: [ 'example-url.com', 'cookie_name=cookie_value']},
  {navigate: 'http://example-url.com'}
]);

wpt.runTest( script, options_wpt,  function( err, data ) {
  ...

@jfsiii
Copy link

jfsiii commented Apr 18, 2016

@7Ds7 does it work if you include the scheme, e.g.:

{setCookie: [ 'http://example-url.com', 'cookie_name=cookie_value']}

@7Ds7
Copy link

7Ds7 commented Apr 19, 2016

@jfsiii that seems to be exactly it ohhh my, thanks a lot :)

@siteriaitaliana
Copy link

siteriaitaliana commented Oct 28, 2017

same issue here, and the customHeaders param allowed in the UI is not supported here as well (i couldn't find it between the mapping). @marcelduran any idea on why?

@mkopala
Copy link

mkopala commented May 15, 2020

I just tried to use customHeaders too, but notice it's not supported and not present in the mapping.js file.

Referenced:

@NikolozCh
Copy link

Hello from 2024. This is still actual. I console logged the result of scriptToString method, I copied it in UI and setHeader works great. However, from code, it's not supported?? as I see in logs header has blank value :( Why is this problem still active. for 9 years.

@danwfreeman
Copy link
Author

I've been using the Lighthouse node program from Google directly and it works great, it's what WPT uses under the covers, so I think better to just bypass WPT anyway. Unless there is some extraordinary feature you need from WPT?
Most features can be coded up in Lighthouse anyway

@NikolozCh
Copy link

Thanks @danwfreeman. I think I will start using Lighthouse as well. Just push HTML report to S3 and reference it inside the reports. Nice to know, I will save some $$. Shame on WPT team lol. Losing clients over 9-year-old-still-open-issues

@diego-s-lopez
Copy link

Hello there! Merry Christmas! Maybe Santa can bring us the solution for this ticket? I need it for add headers to the lighthouse tests. Thanks!

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

No branches or pull requests

7 participants