Open Bug 970195 Opened 10 years ago Updated 5 years ago

rewrite attachments with meta-refreshes to github pull requests as text/x-github-pull-request

Categories

(bugzilla.mozilla.org :: Extensions, task)

Production
x86
macOS
task
Not set
normal

Tracking

()

People

(Reporter: glob, Unassigned)

Details

(On Bug 917878 said Asa Dotzler [:asa] from comment #6)
> Any chance you all can also capture this pull-request.html (text/html)
> pattern? I see it a lot in Firefox OS, like
> https://bugzilla.mozilla.org/show_bug.cgi?id=922609

<!DOCTYPE html><meta charset="utf-8"><meta http-equiv="refresh" content="5;https://github.com/mozilla-b2g/gaia/pull/16017"><title>Bugzilla Code Review</title><p>You can review this patch at <a href="https://github.com/mozilla-b2g/gaia/pull/16017">https://github.com/mozilla-b2g/gaia/pull/16017</a>, or wait 5 seconds to be redirected there automatically.</p>

to do this we'll have to:
- extract an <meta> tags from the html with http-equiv="refresh"
- check that the content redirects to a github PR (ignoring the delay time)
- replace the data with just the PR url
- change the content-type to text/x-github-pull-request

as this means we will be modifying what a user has uploaded, we should also display a message indicating that the transformation has taken place.

this needs to happen when an attachment is uploaded, and also in a migration script. there's no need for a full html parser to be involved, but we'll have to be reasonably flexible with the regexs (eg. don't rely on the order of the attributes).
Type: defect → task
Component: Extensions: BMO → Extensions
You need to log in before you can comment on or make changes to this bug.