?force=1 is appended to update url even when the url supplies params

RESOLVED FIXED in mozilla1.9.1b1

Status

()

Toolkit
Application Update
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: rstrong, Assigned: rstrong)

Tracking

Trunk
mozilla1.9.1b1
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Comment hidden (empty)
Created attachment 337603 [details] [diff] [review]
patch rev1

also lessens the calls to getUpdateURL
Assignee: nobody → robert.bugzilla
Attachment #337603 - Flags: review?(dtownsend)
Attachment #337603 - Flags: review?(dtownsend) → review+
Comment on attachment 337603 [details] [diff] [review]
patch rev1

>     if (force)
>-      url += "?force=1"
>+      url += ((/\?/.test(url)) ? "&" : "?") + "force=1";

Don't know if it is just quicker to do url.indexOf("?"), not really important though.

Can we test this?
(In reply to comment #2)
> (From update of attachment 337603 [details] [diff] [review])
> >     if (force)
> >-      url += "?force=1"
> >+      url += ((/\?/.test(url)) ? "&" : "?") + "force=1";
> 
> Don't know if it is just quicker to do url.indexOf("?"), not really important
> though.
> 
> Can we test this?
Definitely... I'll add it to the existing url tests.

I'll also switch it to indexOf. I just threw this together while a bit ticked off at the code since it was causing problems with other work I was trying to do.
Created attachment 338366 [details] [diff] [review]
patch rev2 with comments addressed

Besides the nit and adding the tests I also removed the setting of the default pref for the general.useragent.locale since the update service doesn't use that at all anymore hence it is irrelevant.
Attachment #337603 - Attachment is obsolete: true
Attachment #338366 - Flags: review+
Target Milestone: --- → mozilla1.9.1b1
Pushed to mozilla-central
http://hg.mozilla.org/mozilla-central/rev/ab6bf11b84b6a893df0452d40eae297de9c9a1ff
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.