Skip to content

unix new-lines in headers possible#8

Closed
dr-diesel wants to merge 1 commit intomilo:masterfrom
dr-diesel:patch-1
Closed

unix new-lines in headers possible#8
dr-diesel wants to merge 1 commit intomilo:masterfrom
dr-diesel:patch-1

Conversation

@dr-diesel
Copy link
Copy Markdown

"\n" caused E_NOTICE with undefined offset 1

@milo
Copy link
Copy Markdown
Owner

milo commented Feb 6, 2015

The \r\n is by HTTP specification, should be platform independent. Could you provide all $line dumps?

@dr-diesel
Copy link
Copy Markdown
Author

It was yesterday on some github api requests, closing headers by "\n" . Unable to reproduce today, maybe some temporary bug. Anyway, cURL recognizes it as header and sends $line into closure, causing setting empty header in array and issuing E_NOTICE "Undefined index 1" . It's matter of opinion if silently ignore invalid headers or issue E_USER_NOTICE or exception. "Undefined index 1" is neither of them.

@milo
Copy link
Copy Markdown
Owner

milo commented Feb 8, 2015

I think it was due to long header splitted on multiple lines (f8dc2d4).

@milo milo closed this Mar 28, 2015
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