Skip to content

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

Merged
dgtlmoon merged 2 commits into
dgtlmoon:masterfrom
culturecloud:dev
Jan 25, 2025
Merged

Fix header parsing to split on the first colon only#2929
dgtlmoon merged 2 commits into
dgtlmoon:masterfrom
culturecloud:dev

Conversation

@iafuad
Copy link
Copy Markdown
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
Copy Markdown
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
@dgtlmoon
Copy link
Copy Markdown
Owner

Amazing, thank you so much

@iafuad iafuad deleted the dev branch February 15, 2025 13:52
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