[Request Header Parser] glitch didn't show a correct response even though localhost works

[Request Header Parser] glitch didn't show a correct response even though localhost works
0

#1

Hello! I’m working on Request Header Parser. I have finished my project. It worked fine in my localhost.

Then I uploaded it to Glitch. Then it returned a wrong response. I couldn’t figure it out why it didn’t work on Glitch.

In localhost, it returns
{"ipaddress":"::1","language":"ja","software":"Macintosh Intel macOS 10.12"}

In Glitch, it returns
{"ipaddress":"92.200.186.18,::ffff:10.10.11.91,::ffff:127.0.0.1,10.10.10.248,::ffff:172.17.0.1","language":"ja","software":"Linux Intel"}

My ip address is “92.200.186.18”… and OS is “Macintosh Intel macOS 10.12”…

Github repo
Project link

Did anybody have a similar experience? How did you solve it?

Thanks in advance,


#2

Hey Aaayumi,

I went to your endpoint and received the correct information for my browser. Have you since posting fixed this issue?

Doug


#3

Yes, I fixed the issue! I added app.enable('trust proxy'); and modified codes a bit.

Thank you for checking up.