make sure the query params are stripped from the updateUrl
This commit is contained in:
parent
154ca8575c
commit
6c4016af46
1 changed files with 9 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
{EventEmitter} = require 'events'
|
{EventEmitter} = require 'events'
|
||||||
SquirrelUpdate = require './auto-updater/squirrel-update-win'
|
SquirrelUpdate = require './auto-updater/squirrel-update-win'
|
||||||
app = require('app')
|
app = require('app')
|
||||||
|
url = require('url')
|
||||||
|
|
||||||
class AutoUpdater extends EventEmitter
|
class AutoUpdater extends EventEmitter
|
||||||
|
|
||||||
|
@ -11,7 +12,14 @@ class AutoUpdater extends EventEmitter
|
||||||
setFeedUrl: (updateUrl) ->
|
setFeedUrl: (updateUrl) ->
|
||||||
# set feed URL only when it hasn't been set before
|
# set feed URL only when it hasn't been set before
|
||||||
unless @updateUrl
|
unless @updateUrl
|
||||||
@updateUrl = updateUrl
|
# See https://github.com/Squirrel/Squirrel.Windows/issues/132
|
||||||
|
# This way the Mac and Windows Update URL can be the same, even when
|
||||||
|
# the Mac version is sending additional data in the query string.
|
||||||
|
parsedUrl = url.parse(updateUrl)
|
||||||
|
delete parsedUrl.search
|
||||||
|
delete parsedUrl.query
|
||||||
|
|
||||||
|
@updateUrl = url.format(parsedUrl)
|
||||||
|
|
||||||
checkForUpdates: ->
|
checkForUpdates: ->
|
||||||
throw new Error('Update URL is not set') unless @updateUrl
|
throw new Error('Update URL is not set') unless @updateUrl
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue