Skip to content

resume flag overwrites output file #792

Closed
@minispooner

Description

@minispooner

httpx version:

v1.2.4

Current Behavior:

when passing -resume and -o OUTPUT_FILE flags, httpx clears and overwrites the OUTPUT_FILE contents

Expected Behavior:

when passing -resume and -o OUTPUT_FILE flags, httpx should NOT clear and overwrite the OUTPUT_FILE contents. instead, httpx should APPEND to the OUTPUT_FILE contents (but not write the application header display again, simply pick up where it left off).

Steps To Reproduce:

setup dummy hosts file

echo "example.com" > five_hosts.txt
echo "www.google.com" >> five_hosts.txt
echo "www.facebook.com" >> five_hosts.txt
echo "example2.com" >> five_hosts.txt
echo "www.twitter.com" >> five_hosts.txt

setup resume.cfg file to pretend like httpx has already run once

echo "resume_from=www.facebook.com" > resume.cfg
echo "index=3" >> resume.cfg # not sure if index is 0-based or 1-based...

setup a fake previous* run output file

echo "this text will no longer appear" > out.txt

run 2nd attempt of httpx

cat five_hosts.txt | httpx -o out.txt -resume
cat out.txt | grep "this text will no longer appear"

text not found using grep, showing that the -resume flag overwrites previous output data instead of appending to it. "resume" should intuitively append, not overwrite

I just ran these steps and validated the steps to reproduce work as described above.

screenshot below
image

Activity

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

Metadata

Metadata

Assignees

Labels

Priority: MediumThis issue may be useful, and needs some attention.Status: CompletedNothing further to be done with this issue. Awaiting to be closed.Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions