There is an issue with PHP Content-Type headers.
when header()
function is NOT USED, php returns 2 headers:
1: Content-Type: text/html; charset=UTF-8
2: Content-Type: text/html
when header('Content-Type: text/html')
is used, php returns 2 headers:
1: Content-Type: text/html; charset=UTF-8
2: Content-Type: text/html; charset=UTF-8
when header('Content-Type: text/event-stream')
is used, php returns 2 headers:
1: Content-Type: text/event-stream; charset=UTF-8
2: Content-Type: text/event-stream; charset=UTF-8
when header('Content-Type: application/json')
is used, php returns ONLY 1 (as ecpected) headers:
1: Content-Type: application/json
WHAT WORKS AS EXPECTED:
When header('Content-Type: application/json')
is used:
correctly returned: Content-Type: application/json
WHAT IS EXPECTED:
When no headers set:
expected: Content-Type: text/html
When header('Content-Type: text/html')
is used:
expected: Content-Type: text/html
When header('Content-Type: text/html; charset=UTF-8')
is used:
expected: Content-Type: text/html; charset=UTF-8
When header('Content-Type: text/event-stream')
is used:
expected: Content-Type: text/event-stream
I hope I am clear enough.