Skip to content

Commit

Permalink
いくつかのURLを入力する項目で最後にスラッシュが含まれるとエラーになっていたので修正
Browse files Browse the repository at this point in the history
  • Loading branch information
tegnike committed Aug 27, 2024
1 parent 070c156 commit daa5296
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/features/chat/difyChat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function getDifyChatResponseStream(
files: [],
})

const response = await fetch(url, {
const response = await fetch(url.replace(/\/$/, ''), {
method: 'POST',
headers: headers,
body: body,
Expand Down
2 changes: 1 addition & 1 deletion src/features/chat/localLLMChat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export async function getLocalLLMChatResponseStream(
model?: string
) {
const response = await axios.post(
localLlmUrl,
localLlmUrl.replace(/\/$/, ''),
{
model: model,
messages: messages,
Expand Down
2 changes: 1 addition & 1 deletion src/features/messages/speakCharacter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export const fetchAudioVoiceGSVIApi = async (
speed: number
): Promise<ArrayBuffer> => {
const style = talk.style !== 'talk' ? talk.style : 'default'
const response = await fetch(url, {
const response = await fetch(url.replace(/\/$/, ''), {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/stylebertvits2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default async function handler(

try {
const voice = await fetch(
`${stylebertvits2ServerUrl}/voice?${queryParams}`,
`${stylebertvits2ServerUrl.replace(/\/$/, '')}/voice?${queryParams}`,
{
method: 'GET',
headers: {
Expand Down

0 comments on commit daa5296

Please sign in to comment.