File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ Request URI manipulations can be done thanks to several plugins:
8
8
* ``AddPathPlugin ``: Prefix the request path with a path, leaving the host information untouched.
9
9
* ``BaseUriPlugin ``: It's a combination of ``AddHostPlugin `` and ``AddPathPlugin ``.
10
10
11
- Each plugin use the ``UriInterface `` to build the base request::
11
+ Each plugin uses the ``UriInterface `` to build the base request::
12
12
13
13
use Http\Discovery\HttpClientDiscovery;
14
14
use Http\Discovery\UriFactoryDiscovery;
@@ -24,3 +24,14 @@ Each plugin use the ``UriInterface`` to build the base request::
24
24
HttpClientDiscovery::find(),
25
25
[$plugin]
26
26
);
27
+
28
+ The ``AddPathPlugin `` will check if the path prefix is already present on the
29
+ URI. This will break for the edge case when the prefix is repeated. For example,
30
+ if ``https://example.com/api/api/foo `` is a valid URI on the server and the
31
+ configured prefix is ``/api ``, the request to ``/api/foo `` is not rewritten.
32
+
33
+ For further details, please see the phpdoc on the ``AddPathPlugin `` source code.
34
+
35
+ No solution fits all use cases. This implementation works fine for the common
36
+ use cases. If you have a specific situation where this is not the right thing,
37
+ you can build a custom plugin that does exactly what you need.
You can’t perform that action at this time.
0 commit comments