Litespeed is passing wrong header name

#1
Hey all,

I have some issues with psr7 receiving headers from litespeed, in the validationHeader method i am receiving the following headers:
  1. Host ****.ng
  2. X-Forwarded-Schem https
  3. X-ForProto -Proto https
X-ForProto -Proto isn't a valid RFC header, it should be x-forwarded-for-proto.
This issue is since i moved from nginx to litespeed so it should be a lightspeed problem.

Is there anyone who know how to fix this?

Bryan
 
#3
what do you mean about this? i'm not receiving the correct header, "X-ForProto -Proto" instead of "X-Forwarded-Proto".

If I print getallheaders() function i receive X-ForProto -Proto, if I print $_SERVER i see X-Forwarded-Proto

getallheaders came from the apache_request_headers() function

Array
(
[Host] =>
[X-Forwarded-Schem] => https
[X-ForProto -Proto] => https
[X-Forwarded-For] => 141.101.76.
[X-Real-IP] => 141.101.76
[Connection] => close
[cf-connecting-ip] => 77.169.53.76
[cdn-loop] => cloudflare
[Accept-Encoding] => gzip
[cf-ipcountry] => NL
[cf-ray] => 7178ab083992978e-AMS
[cf-visitor] => {"scheme":"https"}
[Cache-Control] => max-age=0
[sec-ch-ua] => " Not A;Brand";v="99", "Chromium";v="102", "Microsoft Edge";v="102"
[sec-ch-ua-mobile] => ?0
[sec-ch-ua-platform] => "Windows"
[upgrade-insecure-requests] => 1
[User-Agent] => Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Edg/102.0.1245.33
[Accept] => text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
[sec-fetch-site] => none
[sec-fetch-mode] => navigate
[sec-fetch-user] => ?1
[sec-fetch-dest] => document
[Accept-Language] => en-US,en;q=0.9
[Cookie] =>
)
 
Last edited:
#5
In lsphp81 (version 8.1.6) my phpinfo is response

$_SERVER['HTTP_X_FORPROTO__PROTO'] https

instead of

$_SERVER['HTTP_X_FORPROTO_PROTO'] https

there is a double underscore (__) in the first one.

How is this possible?
 
Top