From 67929d8b195c3617434e09703eb2e03fcd3e9697 Mon Sep 17 00:00:00 2001 From: davtur19 Date: Sat, 13 Mar 2021 19:26:03 +0100 Subject: [PATCH] Fix #5 Fixed detection of .git folders --- dotgit.js | 4 ++-- manifest.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dotgit.js b/dotgit.js index 548c526..bdfa7c4 100644 --- a/dotgit.js +++ b/dotgit.js @@ -137,6 +137,7 @@ function setBadge() { function checkGit(url, visitedSite) { let to_check = url + GIT_HEAD_PATH; + const search = new RegExp(GIT_OBJECTS_SEARCH, "y"); fetch(to_check, { redirect: "manual" @@ -146,7 +147,7 @@ function checkGit(url, visitedSite) { } return false; }).then(function (text) { - if (text !== false && text.startsWith(GIT_HEAD_HEADER) === true) { + if (text !== false && (text.startsWith(GIT_HEAD_HEADER) === true || search.test(text) === true)) { // .git found visitedSite.withExposedGit.push({type: "git", url: url}); chrome.storage.local.set(visitedSite); @@ -586,7 +587,6 @@ chrome.storage.local.get(["checked", "withExposedGit", "options"], function (res if (save) { result.checked.push(url); chrome.storage.local.set(result); - console.log(result); } } }); diff --git a/manifest.json b/manifest.json index faec650..d08ea4a 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "DotGit", - "version": "4.2.2", + "version": "4.2.3", "description": "An extension for checking if .git is exposed in visited websites", "icons": { "16": "icons/dotgit-16.png",