Commit 8810cd2
Before this commit:
WebSocket client conveys CSRF token to server via `:csrf-token` query param.
After this commit:
WebSocket client conveys CSRF token to server via `Sec-WebSocket-Protocol` header.
Motivation:
Moving the token from query param to a header helps reduce the likelihood of
accidental leaking (e.g. via logging).
While the `Sec-WebSocket-Protocol` header isn't specifically intended for conveying
metadata like a CSRF token, the consensus seems to be that this is anyway a practical
choice without major downsides or obviously better alternatives.
As implemented the change tries to respect other values in the `Sec-WebSocket-Protocol`
header that may have been set when calling `make-channel-socket-client!`.
1 parent 9b8c7c7 commit 8810cd2
1 file changed
+33
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
| 372 | + | |
| 373 | + | |
372 | 374 | | |
373 | 375 | | |
374 | 376 | | |
| |||
633 | 635 | | |
634 | 636 | | |
635 | 637 | | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
636 | 653 | | |
637 | 654 | | |
638 | 655 | | |
| |||
642 | 659 | | |
643 | 660 | | |
644 | 661 | | |
645 | | - | |
| 662 | + | |
| 663 | + | |
646 | 664 | | |
647 | 665 | | |
648 | 666 | | |
| |||
1316 | 1334 | | |
1317 | 1335 | | |
1318 | 1336 | | |
1319 | | - | |
| 1337 | + | |
| 1338 | + | |
1320 | 1339 | | |
1321 | 1340 | | |
1322 | 1341 | | |
| |||
1569 | 1588 | | |
1570 | 1589 | | |
1571 | 1590 | | |
1572 | | - | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
1573 | 1602 | | |
1574 | 1603 | | |
1575 | | - | |
1576 | | - | |
1577 | | - | |
1578 | | - | |
| 1604 | + | |
1579 | 1605 | | |
1580 | 1606 | | |
1581 | 1607 | | |
| |||
0 commit comments