Skip to content

Commit be63265

Browse files
authored
Merge pull request #1284 from relu91/fix_1281
Console warning when no subprotocol is defined in http form
2 parents 9d3858c + fc01e84 commit be63265

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

packages/binding-http/src/http-client-impl.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,12 @@ export default class HttpClient implements ProtocolClient {
158158
complete?: () => void
159159
): Promise<Subscription> {
160160
const defaultSubprotocol = "longpoll";
161-
const subprotocol = form.subprotocol ?? defaultSubprotocol;
161+
let subprotocol = form.subprotocol;
162+
163+
if (subprotocol == null) {
164+
warn(`Subscribing to ${form.href} using long polling for form without subprotocol`);
165+
subprotocol = defaultSubprotocol;
166+
}
162167

163168
let internalSubscription: InternalSubscription;
164169
if (subprotocol === defaultSubprotocol) {

0 commit comments

Comments
 (0)