Skip to content

Commit

Permalink
Fix #5
Browse files Browse the repository at this point in the history
Fixed detection of .git folders
  • Loading branch information
davtur19 committed Mar 13, 2021
1 parent 2e3e2f2 commit 67929d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dotgit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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);
Expand Down Expand Up @@ -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);
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 67929d8

Please sign in to comment.