Skip to content

OTA - update documentation example for Apache 2.4 - #9291

Merged
mcspr merged 2 commits into
esp8266:masterfrom
arduino-hmueller01:update-ota-php-example
Nov 18, 2026
Merged

mcspr merged 2 commits into
esp8266:masterfrom
arduino-hmueller01:update-ota-php-example

Conversation

@hmueller01

Copy link
Copy Markdown
Contributor

Updated to work with Apache 2.4 (getallheaders() returns keys in pascal case now). Using change case to lower to work with all versions.

@mcspr mcspr changed the title update OTA documentation example OTA - update documentation example for Apache 2.4 Nov 18, 2026
@hmueller01

Copy link
Copy Markdown
Contributor Author

Possible to merge this?

@mcspr

mcspr commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Wouldn't it also make sense to lowercase any checkheader inputs? i.e. $name -> $name.toLowerCase() (or how it is called within PHP runtime)

@mcspr
mcspr merged commit 7d5a4ce into esp8266:master Nov 18, 2026
28 checks passed
@hmueller01

Copy link
Copy Markdown
Contributor Author

Wouldn't it also make sense to lowercase any checkheader inputs? i.e. $name -> $name.toLowerCase() (or how it is called within PHP runtime)

Yup, I was thinking about this. But then I discarded the idea as it would only help in check_header().
Here we still need to care for the case

$mode = $headers['x-esp8266-mode'];
$mac = $headers['x-esp8266-sta-mac'];

as long as we do not implement a get_header() function. But I think as long as it's only an example to show how to implement this, it's just too much.

More detailed information can be found here
https://www.php.net/manual/en/function.getallheaders.php
According to HTTP specification header names are case-insensitive, so lowering all and comparing to lower-case names is fine. If I remember right before Apache 2.4 apache_request_headers() didn't change the case of what we get from ESP8266. So old code worked. But we didn't respect the specification to be case-insensitive ...

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