First, thanks for this library, I've been using it for some time to pull down .ics files from https://trello.com and parse them, it's been great!
Recently, however, it started failing with:
file(https://trello.com/calendar/58818099de7afeb3eccf53c3/596c082de8b3646b91fe224c/a33556c5da5218fe3ed14f368b6b77bc.ics): failed to open stream: HTTP request failed! HTTP/1.1 426 Upgrade Required
So it looks like Trello is phasing out their use of http/1.0, as I would assume many sites are, given that http/1.1 was released in 1999.
Having a look at the code, I found that remote .ics files are being downloaded with stream_context_create() -- unfortunately, the protocol_version is set to 1.0by default.
I can fix this by adding this to the fileOrUrl() method:
First, thanks for this library, I've been using it for some time to pull down
.ics
files from https://trello.com and parse them, it's been great!Recently, however, it started failing with:
So it looks like Trello is phasing out their use of
http/1.0
, as I would assume many sites are, given thathttp/1.1
was released in 1999.Having a look at the code, I found that remote
.ics
files are being downloaded withstream_context_create()
-- unfortunately, theprotocol_version
is set to1.0
by default.I can fix this by adding this to the
fileOrUrl()
method:and it seems like a sane default to me... but perhaps also to mitigate issues like this, an optional header array could be passed in to use as well?
Happy to PR it in, lmk!