From 076aa263b581684620cf8ae91af924341703efea Mon Sep 17 00:00:00 2001 From: Calle Svensson Date: Sun, 4 Jun 2023 15:12:08 +0200 Subject: [PATCH 1/2] Add note about adapter prefix match to docs --- docs/user/advanced.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst index c664a83d30..4146b13e40 100644 --- a/docs/user/advanced.rst +++ b/docs/user/advanced.rst @@ -994,6 +994,10 @@ The mount call registers a specific instance of a Transport Adapter to a prefix. Once mounted, any HTTP request made using that session whose URL starts with the given prefix will use the given Transport Adapter. +.. note:: The adapter will be chosen based on a longest prefix match of the raw URL. + Be mindful of how you define your prefix. For example, the prefix ``http://localhost`` will also match + ``http://localhost.other.com`` or ``http://localhost@other.com``. + Many of the details of implementing a Transport Adapter are beyond the scope of this documentation, but take a look at the next example for a simple SSL use- case. For more than that, you might look at subclassing the From bab04da9d048a846fdcb515f2efb5c926060c8fd Mon Sep 17 00:00:00 2001 From: Nate Prewitt Date: Sat, 29 Jul 2023 20:27:56 -0700 Subject: [PATCH 2/2] Update note --- docs/user/advanced.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst index 4146b13e40..cd4a20778d 100644 --- a/docs/user/advanced.rst +++ b/docs/user/advanced.rst @@ -994,9 +994,9 @@ The mount call registers a specific instance of a Transport Adapter to a prefix. Once mounted, any HTTP request made using that session whose URL starts with the given prefix will use the given Transport Adapter. -.. note:: The adapter will be chosen based on a longest prefix match of the raw URL. - Be mindful of how you define your prefix. For example, the prefix ``http://localhost`` will also match - ``http://localhost.other.com`` or ``http://localhost@other.com``. +.. note:: The adapter will be chosen based on a longest prefix match. Be mindful + prefixes such as ``http://localhost`` will also match ``http://localhost.other.com`` + or ``http://localhost@other.com``. It's recommended to terminate full hostnames with a ``/``. Many of the details of implementing a Transport Adapter are beyond the scope of this documentation, but take a look at the next example for a simple SSL use-