Skip to content

Commit

Permalink
Fix base64 decode
Browse files Browse the repository at this point in the history
  • Loading branch information
pomber committed Feb 7, 2019
1 parent e4ea3a1 commit 0b043a6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"private": true,
"dependencies": {
"diff": "^4.0.1",
"js-base64": "^2.5.1",
"netlify-auth-providers": "^1.0.0-alpha5",
"prismjs": "^1.15.0",
"react": "^16.8.1",
Expand Down
5 changes: 3 additions & 2 deletions src/github.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { getLanguageDependencies } from "./language-detector";
import netlify from "netlify-auth-providers";
import { Base64 } from "js-base64";
import { getLanguageDependencies } from "./language-detector";
const TOKEN_KEY = "github-token";

function getHeaders() {
Expand All @@ -21,7 +22,7 @@ async function getContent(repo, sha, path) {
throw contentResponse;
}
const contentJson = await contentResponse.json();
const content = window.atob(contentJson.content);
const content = Base64.decode(contentJson.content);
return { content, url: contentJson.html_url };
}

Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5595,6 +5595,11 @@ joi@^11.1.1:
isemail "3.x.x"
topo "2.x.x"

js-base64@^2.5.1:
version "2.5.1"
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.5.1.tgz#1efa39ef2c5f7980bb1784ade4a8af2de3291121"
integrity sha512-M7kLczedRMYX4L8Mdh4MzyAMM9O5osx+4FcOQuTvr3A9F2D9S5JXheN0ewNbrvK2UatkTRhL5ejGmGSjNMiZuw==

js-levenshtein@^1.1.3:
version "1.1.4"
resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.4.tgz#3a56e3cbf589ca0081eb22cd9ba0b1290a16d26e"
Expand Down

0 comments on commit 0b043a6

Please sign in to comment.