segmentio / segmentio/analytics.js-integrations

fail to load heap-{id}.js when the website is under http

Open Beginner friendly
#642 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
125
Forks
136
Avg merge
2h 45m
Merged PRs (30d)
1

Description

Greetings,

The issue is if the website is running under http instead of https (which could be common at development phase), the heap integration will be broken, since it will use the current website schema to load the heap.js from CDN. However while issuing the http://cdn.heapanalytics.com/js/heap-"+e+".js, this will be an error (actually 302 redirect to https://cdn.heapanalytics.com/js/heap-"+e+".js), but the browser (at least for Mac Safari) will fail to load such file. The fix is easy, always load the heap.js from CDN via https

https://github.com/segmentio/analytics.js-integrations/blob/0c0f9eb070e61f1f43c014062d3c5df1ccfd12e4/integrations/heap/lib/index.js#L24

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Check integrations/heap/lib/index.js around line 24 and inspect how the heap-{id}.js CDN URL is formed. Reproduce the issue with the website served over HTTP, then verify that the Heap script loads successfully without the redirect failure described for Safari.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
analytics
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.