Skip to content

Commit

Permalink
Merge pull request #853 from Thijn/main
Browse files Browse the repository at this point in the history
fix: Automatically prepend https for Overseerr, Sonarr and Radarr when using port 443
  • Loading branch information
jorenn92 authored Mar 25, 2024
2 parents e0c4dca + 1616cfd commit 995d01e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
5 changes: 4 additions & 1 deletion ui/src/components/Settings/Overseerr/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ const OverseerrSettings = () => {
? hostnameRef.current.value
: hostnameRef.current.value.includes('https://')
? hostnameRef.current.value
: 'http://' + hostnameRef.current.value
: portRef.current.value == '443'
? 'https://' + hostnameRef.current.value
: 'http://' + hostnameRef.current.value

const payload = {
overseerr_url: addPortToUrl(hostnameVal, +portRef.current.value),
overseerr_api_key: apiKeyRef.current.value,
Expand Down
6 changes: 4 additions & 2 deletions ui/src/components/Settings/Radarr/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ const RadarrSettings = () => {
portRef.current?.value &&
apiKeyRef.current?.value
) {
const hostnameVal = hostnameRef.current.value.includes('http')
const hostnameVal = hostnameRef.current.value.includes('http://')
? hostnameRef.current.value
: hostnameRef.current.value.includes('https')
: hostnameRef.current.value.includes('https://')
? hostnameRef.current.value
: portRef.current.value == '443' ?
'https://' + hostnameRef.current.value
: 'http://' + hostnameRef.current.value

let radarr_url = `${addPortToUrl(hostnameVal, +portRef.current.value)}`
Expand Down
6 changes: 4 additions & 2 deletions ui/src/components/Settings/Sonarr/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ const SonarrSettings = () => {
portRef.current?.value &&
apiKeyRef.current?.value
) {
const hostnameVal = hostnameRef.current.value.includes('http')
const hostnameVal = hostnameRef.current.value.includes('http://')
? hostnameRef.current.value
: hostnameRef.current.value.includes('https')
: hostnameRef.current.value.includes('https://')
? hostnameRef.current.value
: portRef.current.value == '443'
? 'https://' + hostnameRef.current.value
: 'http://' + hostnameRef.current.value

let url = `${addPortToUrl(hostnameVal, +portRef.current.value)}`
Expand Down

0 comments on commit 995d01e

Please sign in to comment.