Skip to content

Add --method and --any-status flags for tricky targets - #67

Merged
arthaud merged 2 commits into
arthaud:masterfrom
C00kiie:pr/method-any-status
Aug 28, 2026
Merged

Add --method and --any-status flags for tricky targets#67
arthaud merged 2 commits into
arthaud:masterfrom
C00kiie:pr/method-any-status

Conversation

@C00kiie

@C00kiie C00kiie commented Aug 25, 2026

Copy link
Copy Markdown

Some targets only serve raw .git files over a non-GET method, or respond with a non-200 status (e.g. 500) while still returning the real content. Stock git-dumper can't dump these.

  • -X/--method — HTTP method for all requests (default GET). Every session.get(...) is now session.request(method, ...), threaded through the probe, ref, object, and recursive-download paths.
  • --any-status — accept any status code as long as the body is non-empty and not HTML. Default off, so existing 200-only behavior is preserved.
  • Hardens object discovery so a corrupt .git/index or pack (e.g. an error page saved via --any-status) is skipped with a warning instead of aborting the whole dump.

README documents both flags with examples.

Example

# Target that only serves clean content over POST
git-dumper -X POST http://target/.git ~/loot

# Target that returns 500 (or other codes) but with real content
git-dumper --any-status http://target/.git ~/loot

Some targets only serve raw .git files over a non-GET method, or respond with
a non-200 status (e.g. 500) while still returning the real content.

- -X/--method: HTTP method used for all requests (default GET). Every
  session.get(...) is now session.request(method, ...), threaded through the
  probe, ref, object and recursive-download paths.
- --any-status: accept any status code as long as the body is non-empty and
  not HTML. Default off, so existing 200-only behaviour is preserved.

Also harden object discovery so a corrupt .git/index or pack (e.g. an error
page saved via --any-status) is skipped with a warning instead of aborting the
whole dump.

README documents both flags with examples.

@arthaud arthaud left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, would just like a minor change for the README, see comment

Comment thread README.md Outdated
Comment on lines 65 to 77
Some targets only serve the raw `.git` files over a non-`GET` method, or
respond with a non-200 status (e.g. `500`) while still returning the real
content. For those, combine `--method` and/or `--any-status`:

```
# Target that only serves clean content over POST
git-dumper -X POST http://website.com/.git ~/website

# Target that returns 500 (or other codes) but with real content
git-dumper --any-status http://website.com/.git ~/website
```


Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we move this in a different section instead of being under Example?
Maybe a section "Custom arguments", and a subsection "HTTP Method" and another one "Ignore HTTP status"?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do tomorrow, noted.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's done.

@C00kiie
C00kiie requested a review from arthaud August 27, 2026 17:52
Address review feedback: split the flag docs out of the Example section
into a dedicated "Custom arguments" section with "HTTP Method" and
"Ignore HTTP status" subsections.
@C00kiie
C00kiie force-pushed the pr/method-any-status branch from ea71191 to 90860da Compare August 27, 2026 17:54
@arthaud
arthaud merged commit 2b47da1 into arthaud:master Aug 28, 2026
@arthaud

arthaud commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants