File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,6 +39,27 @@ public function triggerHook()
3939 $ this ->sendRequest ($ hookUrl , 'post ' , $ options );
4040 }
4141
42+ /**
43+ * {@inheritDoc}
44+ *
45+ * The hook link must use the integration's "self" link as the base, not
46+ * the overridden base URL. This is because the external API proxy does not
47+ * yet support unauthenticated requests.
48+ */
49+ public function getLink ($ rel , $ absolute = true )
50+ {
51+ if ($ rel === '#hook ' ) {
52+ if (!isset ($ this ->data ['_links ' ][$ rel ]['href ' ])) {
53+ throw new \InvalidArgumentException ("Link not found: $ rel " );
54+ }
55+ if (!isset ($ this ->data ['_links ' ]['self ' ]['href ' ])) {
56+ throw new \RuntimeException ('Failed to find integration "self" link ' );
57+ }
58+ return $ this ->makeAbsoluteUrl ($ this ->data ['_links ' ][$ rel ]['href ' ], $ this ->data ['_links ' ]['self ' ]['href ' ]);
59+ }
60+ return parent ::getLink ($ rel , $ absolute );
61+ }
62+
4263 /**
4364 * Validate the integration via the API.
4465 *
You can’t perform that action at this time.
0 commit comments