Skip to content

finalUrl is incorrect #13697

@justlauzadis

Description

@justlauzadis

What happened?

I am writting tests and I wanted to add assertion that finalUrl is as expected, i.e. no redirects happen and we are auditing the expected page. However, after running an audit in a page A which redirects to page B (due to missing/misconfigured authorization) it seems that both requestedUrl and finalUrl in audit result JSON return page A.

UPDATE:
Finally was able to reproduce using a sample from https://codesandbox.io/s/zealous-bird-qok15g?file=/src/App.tsx
Just run an audit for https://qok15g.csb.app/route-one - it redirects to https://qok15g.csb.app/route-two, but audit result still shows the following:

"requestedUrl": "https://qok15g.csb.app/route-one",
"finalUrl": "https://qok15g.csb.app/route-one",

What did you expect?

I expected requestedUrl to refer to page A, and finalUrl - page B.

UPDATE:
Regarding example from https://qok15g.csb.app/route-one, I was expecting the following:

"requestedUrl": "https://qok15g.csb.app/route-one",
"finalUrl": "https://qok15g.csb.app/route-two",

What have you tried?

No response

How were you running Lighthouse?

CLI

Lighthouse Version

9.4.0

Chrome Version

98.0.4758.102

Node Version

14.17.6

OS

Windows

Relevant log output

No response

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions