Open Bug 1696299 Opened 4 years ago Updated 3 years ago

Infinite refresh loop with meta refresh

Categories

(Core :: DOM: Navigation, defect, P5)

defect

Tracking

()

Tracking Status
firefox88 --- affected

People

(Reporter: mt, Unassigned)

References

Details

The following HTML produces a very interesting effect.

<!DOCTYPE html>
<title>Redirect test</title>
<meta http-equiv="refresh" content="0; URL="https://mozilla.org">

It's not obvious at first, but the extra " after URL= is a mistake. I was not careful enough with my insert point originally and left the " before the URL; this works the same without the " at the end too, it seems like the parser just discards garbage after the content attribute is closed.

This leads to an infinite refresh loop, presumably because an empty URL is the same as no URL and that's how the feature works.

Bug? Or working as intended?

Reading bug 170021 it looks like a regression. Reading the patch that was landed it's clear that 0 seconds plus no URL would result in no action. However, the more I think about it, the more I think that the latter might be necessary for some webcompat reason.

This is not a regression of bug 170021. Gecko considers that seconds is specified even if the value is zero. Bug 170021 rules out patterns like content=";URL=".

Severity: -- → N/A
Priority: -- → P5

An empty string ends up being resolved against the document's URL so it navigates there after 0 seconds. This will look like an endless refresh.

As far as I can tell this is what https://html.spec.whatwg.org/#attr-meta-http-equiv-refresh also ends up with. It would be okay to put a limit here, but in the end this is no different from calling location.refresh() from a load event or some such so I'd be inclined to not do anything here unless there's a more concrete problem.

Also changing severity to S4 because N/A results in autonag emails.

Severity: N/A → S4
You need to log in before you can comment on or make changes to this bug.