Skip to content

Commit 137007a

Browse files
Update javascript-client.md (dotnet#20344)
Co-authored-by: Scott Addie <[email protected]>
1 parent 05053b0 commit 137007a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

aspnetcore/signalr/javascript-client.md

+3
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ The following code creates and starts a connection. The hub's name is case insen
6666

6767
Typically, browsers load connections from the same domain as the requested page. However, there are occasions when a connection to another domain is required.
6868

69+
> [!IMPORTANT]
70+
> The client code must use an absolute URL instead of a relative URL. Change `.withUrl("/chathub")` to `.withUrl("https://myappurl/chathub")`.
71+
6972
To prevent a malicious site from reading sensitive data from another site, [cross-origin connections](xref:security/cors) are disabled by default. To allow a cross-origin request, enable it in the `Startup` class:
7073

7174
[!code-csharp[](javascript-client/samples/3.x/SignalRChat/Startup.cs?highlight=16-23,40)]

0 commit comments

Comments
 (0)