Skip to content

Commit

Permalink
Fixed issue with unicode characters when creating banner fingerprint
Browse files Browse the repository at this point in the history
  • Loading branch information
tg666 committed Oct 25, 2023
1 parent 9170da4 commit 526c912
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.3.1] - 2023-10-25

### Fixed

- Fixed issue with unicode characters when creating banner fingerprint.

## [1.2.1] - 2023-10-25

### Fixed

- Fixed issue with unicode characters when creating banner fingerprint.

## [1.3.0] - 2023-10-24

### Added
Expand Down Expand Up @@ -84,8 +96,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Added missing getter `Banner.resources`.

[unreleased]: https://gitlab.com/68publishers/projects/amp/amp-client-js/compare/v1.3.0...master
[unreleased]: https://gitlab.com/68publishers/projects/amp/amp-client-js/compare/v1.3.1...master
[1.3.1]: https://gitlab.com/68publishers/projects/amp/amp-client-js/compare/v1.3.0...v1.3.1
[1.3.0]: https://gitlab.com/68publishers/projects/amp/amp-client-js/compare/v1.2.0...v1.3.0
[1.2.1]: https://gitlab.com/68publishers/projects/amp/amp-client-js/compare/v1.2.0...v1.2.1
[1.2.0]: https://gitlab.com/68publishers/projects/amp/amp-client-js/compare/v1.1.0...v1.2.0
[1.1.0]: https://gitlab.com/68publishers/projects/amp/amp-client-js/compare/v1.0.10...v1.1.0
[1.0.10]: https://gitlab.com/68publishers/projects/amp/amp-client-js/compare/v1.0.9...v1.0.10
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "amp-client",
"version": "1.3.0",
"version": "1.3.1",
"description": "JS Client for 68publishers/amp",
"homepage": "http://www.68publishers.io/",
"main": "index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/banner/fingerprint.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ class Fingerprint {

static createFromProperties(properties) {
return new Fingerprint(
btoa(JSON.stringify(properties)),
btoa(encodeURIComponent(JSON.stringify(properties))),
properties,
);
}

static createFromValue(value) {
return new Fingerprint(
value,
JSON.parse(atob(value)),
JSON.parse(decodeURIComponent(atob(value))),
);
}

Expand Down

0 comments on commit 526c912

Please sign in to comment.