Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix header parsing to split on the first colon only #2929

Merged
merged 2 commits into from
Jan 25, 2025

Conversation

iafuad
Copy link
Contributor

@iafuad iafuad commented Jan 25, 2025

This fixes the changedetectionio.store:get_all_headers_in_textfile_for_watch:559 - ERROR reading headers.txt at datastore/headers.txt too many values to unpack (expected 2) error if the headers contain URLs.

@dgtlmoon
Copy link
Owner

nice find!!!

please update this test before i can merge the fix

with open('test-datastore/headers.txt', 'w') as f:
f.write("global-header: nice\r\nnext-global-header: nice")

you should add an extra header there to check for

assert b"Global-Header:nice" in res.data
assert b"Next-Global-Header:nice" in res.data
assert b"Xxx:ooo" in res.data
assert b"Watch-Header:nice" in res.data
assert b"Tag-Header:test" in res.data

@dgtlmoon dgtlmoon merged commit 1c61b5a into dgtlmoon:master Jan 25, 2025
5 checks passed
@dgtlmoon
Copy link
Owner

Amazing, thank you so much

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