I want to know if it is safe to check the origin/referer header in the https request in backend to know the frontend domain.
As far as I know:
Those headers are set by the browser automatically. People cannot change it via javascript, except they use some modified browser or plugin.
Someone will declare that some proxy software can change the http packet, so someone may use this between the frontend and the backend to fake those headers. But as far as I am concerned, https is encrypted. So this would be impossible.
So if I check those headers and the request is indeed origin from the browser, those headers would reflect the true domain of frontend. Am I correct?
Thanks for the help!