mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2025-12-19 05:47:46 +00:00
when app url is websocket we still need to send to http schema not ws (#439)
* when app url is websocket we still need to send to http schema not ws * fix bug from a previous PR
This commit is contained in:
@@ -12,8 +12,16 @@ const validateAppEnvSchema = (schema) => {
|
||||
|
||||
//Currently this request is not signed with the webhook secret as it is outside an account
|
||||
const fetchAppEnvSchema = async(logger, url) => {
|
||||
// Translate WebSocket URLs to HTTP equivalents (case-insensitive)
|
||||
let fetchUrl = url;
|
||||
if (url.toLowerCase().startsWith('ws://')) {
|
||||
fetchUrl = 'http://' + url.substring(5);
|
||||
} else if (url.toLowerCase().startsWith('wss://')) {
|
||||
fetchUrl = 'https://' + url.substring(6);
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await fetch(url, {
|
||||
const response = await fetch(fetchUrl, {
|
||||
method: 'OPTIONS',
|
||||
headers: {
|
||||
Accept: 'application/json'
|
||||
|
||||
7
package-lock.json
generated
7
package-lock.json
generated
@@ -2129,10 +2129,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@jambonz/speech-utils": {
|
||||
"version": "0.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@jambonz/speech-utils/-/speech-utils-0.2.7.tgz",
|
||||
"integrity": "sha512-cV3RAp3sTchnYy9w0gaAyP2GlmscsMIt3TlcI/7GrTE1DNh7BNMLoQZeo1WprM9w4etVPMCu561O1O/bRlP+gg==",
|
||||
"license": "MIT",
|
||||
"version": "0.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@jambonz/speech-utils/-/speech-utils-0.2.8.tgz",
|
||||
"integrity": "sha512-3MyqNunI3vTYl1np/qyn3b/27dq8Jm8BOC4gARnjMR+40590DAfH3IR1P7gTC2kHbzUMTB8fGY26KLHvmapSSA==",
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-polly": "^3.496.0",
|
||||
"@aws-sdk/client-sts": "^3.496.0",
|
||||
|
||||
Reference in New Issue
Block a user