Skip to content

Commit

Permalink
Update _worker.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jyx04 authored Jun 9, 2024
1 parent 2e7c13a commit def487f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions _worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,13 @@ async function handleInitialPostRequest(request) {
let value = formData.get(field);
if (field === 'WorkerURL' && !value) {
value = (new URL(request.url)).hostname;
await KV.put(field, value);
}
if (field === 'VoiceURL' && !value) {
let hostname = (new URL(request.url)).hostname;
let parts = hostname.split('.');
parts[0] = 'voice';
value = parts.join('.');
}
if (value) {
await KV.put(field, value);
}
}
Expand Down

0 comments on commit def487f

Please sign in to comment.