internetwache/GitTools

Check for redirects and file type in `gitdumper.sh`

alexanderadam opened this issue · 3 comments

I tried a random example and it turned out that requests for various files (i.e. .git/packed-refs, .git/refs/wip/index/refs/heads/master, .git/refs/stash .git/refs/wip/wtree/refs/heads/master, .git/refs/remotes/origin/HEAD, .git/info/refs .git/objects/info/packs, .git/logs/refs/remotes/origin/HEAD) were affected by a HTTP rule. They were redirected to an index HTML file.
So I guess two things should be considered here:

  1. Probably not to follow redirects
  2. Definitely check whether the result is HTML.

Otherwise it will look like this:

fatal: unexpected line in .git/packed-refs: </html>?

PS: Thank you for your work!

Hey @alexanderadam and @xavior1412,
I've implemented

  • A flag to disable redirects
  • Checks for HTML documents
    on the dev branch [0].

Could you please check if that works and fixes your issues?

[0] https://github.com/internetwache/GitTools/tree/dev

I wow. I totally forgot about this issue and I don't know where this cases appeared 🙈
Should I close this issue?

Yeah, sorry for the delay on this one. I'd wait for xavior for a few days and then merge the new features.