Skip to content

Commit

Permalink
fix VITE_COMPANION_ALLOWED_HOSTS (#4690)
Browse files Browse the repository at this point in the history
it was broken
  • Loading branch information
mifi authored Sep 20, 2023
1 parent 94ac4ca commit a16e22e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ VITE_UPLOADER=tus

VITE_COMPANION_URL=http://localhost:3020
# See also Transloadit.COMPANION_PATTERN
VITE_COMPANION_ALLOWED_HOSTS="/\.transloadit\.com\$/"
VITE_COMPANION_ALLOWED_HOSTS="\.transloadit\.com$"
VITE_TUS_ENDPOINT=https://tusd.tusdemo.net/files/
VITE_XHR_ENDPOINT=https://xhr-server.herokuapp.com/upload

Expand Down
4 changes: 3 additions & 1 deletion private/dev/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import generateSignatureIfSecret from './generateSignatureIfSecret.js'
const {
VITE_UPLOADER : UPLOADER,
VITE_COMPANION_URL : COMPANION_URL,
VITE_COMPANION_ALLOWED_HOSTS : companionAllowedHosts,
VITE_TUS_ENDPOINT : TUS_ENDPOINT,
VITE_XHR_ENDPOINT : XHR_ENDPOINT,
VITE_TRANSLOADIT_KEY : TRANSLOADIT_KEY,
Expand All @@ -33,6 +32,9 @@ const {
VITE_TRANSLOADIT_SERVICE_URL : TRANSLOADIT_SERVICE_URL,
} = import.meta.env

const companionAllowedHosts = import.meta.env.VITE_COMPANION_ALLOWED_HOSTS
&& new RegExp(import.meta.env.VITE_COMPANION_ALLOWED_HOSTS)

import.meta.env.VITE_TRANSLOADIT_KEY &&= '***' // to avoid leaking secrets in screenshots.
import.meta.env.VITE_TRANSLOADIT_SECRET &&= '***' // to avoid leaking secrets in screenshots.
console.log(import.meta.env)
Expand Down

0 comments on commit a16e22e

Please sign in to comment.