sct / overseerr

Request management and media discovery tool for the Plex ecosystem
https://overseerr.dev
MIT License
3.54k stars 412 forks source link

Change localhost to process.env.HOST for client requests #3839

Open lmiklosko opened 2 months ago

lmiklosko commented 2 months ago

Description

Server side loads the IP address to bind the socket to from environment variable HOST, but client side expects the API to always be on localhost. This generally works, but when you have IPv6 capable server and trying to bind to IPv4 port (e.g. HOST=127.0.0.1), this does not work as client side has hardcoded localhost instead of using process.env.HOST. As IPv6 takes priority over v4, localhost resolves to ::1 resulting in internal server error.

This fix replaces all occurrences of api calls from localhost:PORT to HOST:PORT.

To-Dos

Issues Fixed or Closed