File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change 6
6
7
7
- RetryPlugin: Renamed the configuration options for the exception retry callback from ` decider ` to ` exception_decider `
8
8
and ` delay ` to ` exception_delay ` . The old names still work but are deprecated.
9
- - AddPathPlugin does not add prefix if the prefix already is defined.
9
+ - AddPathPlugin: Do not add the prefix if the URL already has the same prefix.
10
10
11
11
12
12
## 1.8.2 - 2018-12-14
Original file line number Diff line number Diff line change @@ -18,13 +18,6 @@ final class AddPathPlugin implements Plugin
18
18
*/
19
19
private $ uri ;
20
20
21
- /**
22
- * Stores identifiers of the already altered requests.
23
- *
24
- * @var array
25
- */
26
- private $ alteredRequests = [];
27
-
28
21
/**
29
22
* @param UriInterface $uri
30
23
*/
@@ -42,6 +35,21 @@ public function __construct(UriInterface $uri)
42
35
}
43
36
44
37
/**
38
+ * Adds a prefix in the beginning of the URL's path. We will not add the prefix
39
+ * if it already exists. This will of course not cover all the edge cases. For
40
+ * example when you have a valid URL like `https://example.com/api/api/foo` and
41
+ * you are using the prefix "/api".
42
+ *
43
+ * Some of the other edge cases are:
44
+ * - request objects can be reused,
45
+ * - plugin chains could be restarted
46
+ * - multiple AddPathPlugins may exist in one chain.
47
+ *
48
+ * If one would like to cover all these scenarios one would have to add a custom
49
+ * header to the request to indicate it has been rewritten by the plugin. This
50
+ * implementation does not aim for pleasing all edge cases rather to be great
51
+ * value for the 95% other use cases.
52
+ *
45
53
* {@inheritdoc}
46
54
*/
47
55
public function handleRequest (RequestInterface $ request , callable $ next , callable $ first )
You can’t perform that action at this time.
0 commit comments