Commit 850680f
committed
fix(connection): probe Bearer too, so a half-stripped host stops reading healthy
self_check() could report auth_header: ok on a site where every OAuth
client was being refused, because probe_headers() sent exactly one
loopback and it carried Basic.
Basic is the scheme that survives where others do not. Apache and
LiteSpeed consume an RFC 7617 header natively into PHP_AUTH_USER, so it
reaches PHP even on setups that never forward the raw Authorization
header, and a firewall rule can be written against Bearer alone. On such
a host every pasted-key client works and every app that signs in through
Saddle gets 401 — which reads from outside as "the AI app is broken"
rather than "my server drops a header", and which Saddle's own health
check was confirming.
That matters because the two paths have disjoint client populations.
Application Passwords carry Basic: Claude Code, Claude Desktop, Cursor,
VS Code. OAuth carries Bearer, and ChatGPT has no field for a custom
header, so Bearer is the only way it can ever connect. "Claude works, so
the header is fine" is the wrong inference and this is the code that was
licensing it.
So: a second loopback carrying Bearer, judged on the scheme that arrived
rather than on arrival alone (a host that rewrites an unrecognised
Authorization header would otherwise pass a test it should fail), a
bearer_header field, a bearer_header_stripped status ranked below the
both-stripped case, and htaccess_fixable extended — the rule Saddle
already generates forwards the header whatever scheme it carries, so it
was always the fix for both.
The public probe route gains `scheme`, its first non-boolean. The
contract test pinning its key set caught that, as designed; it is
updated deliberately, and the value is a closed enum naming the shape of
what the caller itself just sent, never any part of it.
Closes #1211 parent ddd82c0 commit 850680f
6 files changed
Lines changed: 280 additions & 48 deletions
File tree
- admin
- build
- src/components
- includes
- languages
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
128 | 135 | | |
129 | 136 | | |
130 | 137 | | |
131 | 138 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
137 | 158 | | |
138 | 159 | | |
139 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
458 | 467 | | |
459 | 468 | | |
460 | 469 | | |
| |||
521 | 530 | | |
522 | 531 | | |
523 | 532 | | |
524 | | - | |
525 | | - | |
526 | | - | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
527 | 537 | | |
528 | 538 | | |
529 | 539 | | |
530 | 540 | | |
531 | 541 | | |
532 | 542 | | |
533 | 543 | | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
534 | 550 | | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
539 | 556 | | |
540 | 557 | | |
541 | 558 | | |
| |||
546 | 563 | | |
547 | 564 | | |
548 | 565 | | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
549 | 573 | | |
550 | 574 | | |
551 | 575 | | |
| |||
566 | 590 | | |
567 | 591 | | |
568 | 592 | | |
569 | | - | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
570 | 604 | | |
571 | 605 | | |
572 | 606 | | |
573 | | - | |
574 | | - | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
575 | 610 | | |
576 | 611 | | |
577 | | - | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
578 | 641 | | |
579 | | - | |
| 642 | + | |
580 | 643 | | |
581 | 644 | | |
582 | 645 | | |
| |||
586 | 649 | | |
587 | 650 | | |
588 | 651 | | |
589 | | - | |
590 | | - | |
| 652 | + | |
591 | 653 | | |
592 | 654 | | |
593 | 655 | | |
594 | 656 | | |
595 | 657 | | |
596 | 658 | | |
597 | 659 | | |
598 | | - | |
| 660 | + | |
599 | 661 | | |
600 | 662 | | |
601 | 663 | | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | 664 | | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
| 665 | + | |
610 | 666 | | |
611 | 667 | | |
612 | 668 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
2096 | 2096 | | |
2097 | 2097 | | |
2098 | 2098 | | |
2099 | | - | |
| 2099 | + | |
2100 | 2100 | | |
2101 | 2101 | | |
2102 | 2102 | | |
2103 | | - | |
| 2103 | + | |
2104 | 2104 | | |
2105 | 2105 | | |
2106 | 2106 | | |
| |||
4513 | 4513 | | |
4514 | 4514 | | |
4515 | 4515 | | |
4516 | | - | |
| 4516 | + | |
4517 | 4517 | | |
4518 | 4518 | | |
4519 | 4519 | | |
4520 | 4520 | | |
4521 | 4521 | | |
4522 | | - | |
| 4522 | + | |
4523 | 4523 | | |
4524 | 4524 | | |
4525 | 4525 | | |
| |||
4728 | 4728 | | |
4729 | 4729 | | |
4730 | 4730 | | |
4731 | | - | |
| 4731 | + | |
| 4732 | + | |
| 4733 | + | |
| 4734 | + | |
| 4735 | + | |
4732 | 4736 | | |
4733 | 4737 | | |
4734 | 4738 | | |
4735 | | - | |
| 4739 | + | |
| 4740 | + | |
| 4741 | + | |
| 4742 | + | |
| 4743 | + | |
4736 | 4744 | | |
4737 | 4745 | | |
4738 | 4746 | | |
4739 | | - | |
| 4747 | + | |
4740 | 4748 | | |
4741 | 4749 | | |
4742 | 4750 | | |
4743 | | - | |
| 4751 | + | |
4744 | 4752 | | |
4745 | 4753 | | |
4746 | 4754 | | |
4747 | | - | |
| 4755 | + | |
4748 | 4756 | | |
4749 | 4757 | | |
4750 | 4758 | | |
4751 | | - | |
| 4759 | + | |
4752 | 4760 | | |
4753 | 4761 | | |
4754 | 4762 | | |
4755 | | - | |
| 4763 | + | |
4756 | 4764 | | |
4757 | 4765 | | |
4758 | 4766 | | |
4759 | | - | |
| 4767 | + | |
4760 | 4768 | | |
4761 | 4769 | | |
4762 | 4770 | | |
4763 | | - | |
| 4771 | + | |
4764 | 4772 | | |
4765 | 4773 | | |
4766 | 4774 | | |
4767 | | - | |
| 4775 | + | |
4768 | 4776 | | |
4769 | 4777 | | |
4770 | 4778 | | |
| |||
0 commit comments