Skip to content

WEB Version has CORS issues #14

@gjwgit

Description

@gjwgit

Problem

For the URL of the CHANGELOG if we use, for example

changelogUrl: 'https://github.com/anusii/notepod/blob/dev/CHANGELOG.md',

when query github we get back CORS issues. Presumably because of missing the appropriate CORS related headers.

Consequently the CHANGELOG is not retrieved for analysis.

If instead we use:

changelogUrl:  'https://raw.githubusercontent.com/anusii/notepod/dev/CHANGELOG.md',

Then we don't get the CORS issue and so the CHANGELOG analysis is just fine.

However, the former when tapped displays the formatted markdown whilst the latter when tapped displays the raw text format.

When tapping the former is best, but for analysis the latter is required on WEB.

Possible Solution

If showDate of VersionWidget is true then let's process the changelogUrl when we want to parse the date information. So, accept the former as the URL but internally when retrieving the CHANGLOG and running on chrome/web if the CORS exception is raised, then try replacing the pattern https://github.com/OWNER/REPO/blob/dev/CHANGELOG.md with https://raw.githubusercontent.com/OWNER/REPO/dev/CHANGELOG.md under the bonnet, and if that fails then we simply don't print the date.

Screenshot

Image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions