Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep getting "invalid JSON response" on private GitHub repo #131

Open
ryandunnewold opened this issue Sep 24, 2021 · 6 comments
Open

Keep getting "invalid JSON response" on private GitHub repo #131

ryandunnewold opened this issue Sep 24, 2021 · 6 comments

Comments

@ryandunnewold
Copy link

ryandunnewold commented Sep 24, 2021

In the docs it says that private repos automatically sets the URL environment variable. It doesn't properly return it though and autoUpdater throws an error:

Here is original code:

hazel/lib/routes.js

Lines 162 to 169 in a06e6c5

send(res, 200, {
name: latest.version,
notes,
pub_date,
url: shouldProxyPrivateDownload
? `${url}/download/${platformName}?update=true`
: latest.platforms[platform].url
})

Here is the solution that worked for me. Curious if there is a more elegant way to solve this:

 send(res, 200, {
    name: latest.version,
    notes,
    pub_date,
    url: shouldProxyPrivateDownload
      ? `https://${url}/download/${platformName}?update=true`
      : latest.platforms[platform].url
  })
@tarikhaiga
Copy link

@ryandunnewold Thanks for sharing this! I'm quite new here, not really sure how I can use your fix with my own private repo?

@Juned-H2
Copy link

Juned-H2 commented Dec 6, 2021

@ryandunnewold Thanks for sharing this! I'm quite new here, not really sure how I can use your fix with my own private repo?

You can edit the files directly in your Vercel hazel fork.

@omerts
Copy link

omerts commented Jan 11, 2022

This is a showstopper bug on macOS that should really be handled immediately. Also the documentation for configuring the server address is missing the https:// prefix.

@omerts
Copy link

omerts commented Jan 11, 2022

@ryandunnewold Thanks for sharing this! I'm quite new here, not really sure how I can use your fix with my own private repo?

You can edit the files directly in your Vercel hazel fork.

I changed it in my fork, but it still returns the old url, is there any other step that needs to be done? like clearing the a cache?

EDIT:
Ok figured it out, had to promote to production, and use the production link for it to work

@btribouillet
Copy link

Same issue here, I will update it in my fork as well.

@Nkzn
Copy link

Nkzn commented Jun 14, 2022

I have same issue.

Request

https://my-hazel-server.vercel.app/update/darwin/0.1.8

Response

{"name":"v0.1.9","notes":null,"pub_date":"2022-06-14T05:50:23Z","url":"my-hazel-server.vercel.app.vercel.app/download/darwin?update=true"}

this response contains "url":"my-hazel-server.vercel.app.vercel.app/download/darwin?update=true". this is wrong url.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants