Skip to content

Commit

Permalink
fix: // in websocketpath (#651)
Browse files Browse the repository at this point in the history
  • Loading branch information
arkxfly committed Apr 7, 2024
1 parent d148c19 commit ed70948
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/signals/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { createEventSignal } from '@solid-primitives/event-listener'
import { makePersisted } from '@solid-primitives/storage'
import { createReconnectingWS } from '@solid-primitives/websocket'
import ky from 'ky'
import _ from 'lodash'
import { createMemo, createSignal } from 'solid-js'

export const [selectedEndpoint, setSelectedEndpoint] = makePersisted(
Expand Down Expand Up @@ -48,7 +49,7 @@ export const endpoint = () =>
export const secret = () => endpoint()?.secret

export const wsEndpointURL = () =>
new URL(endpoint()?.url ?? '').href.replace('http', 'ws')
_.trimEnd(new URL(endpoint()?.url ?? '').href.replace('http', 'ws'), '/')

export const useWsRequest = <T>(
path: string,
Expand Down

0 comments on commit ed70948

Please sign in to comment.