Skip to content
Snippets Groups Projects
Unverified Commit 8f6fd2a7 authored by Lucas Hedding's avatar Lucas Hedding
Browse files

Fixes #257 by add request options

parent 0a1f9752
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,9 @@ source: ...@@ -9,6 +9,9 @@ source:
plugin: url plugin: url
data_fetcher_plugin: http data_fetcher_plugin: http
data_parser_plugin: xml data_parser_plugin: xml
# Guzzle request options can be added.
request_options:
allow_redirects: false
# Normally, this is one or more fully-qualified URLs or file paths. Because # Normally, this is one or more fully-qualified URLs or file paths. Because
# we can't hardcode your local URL, we provide a relative path here which # we can't hardcode your local URL, we provide a relative path here which
# hook_install() will rewrite to a full URL for the current site. # hook_install() will rewrite to a full URL for the current site.
......
...@@ -99,6 +99,9 @@ class Http extends DataFetcherPluginBase implements ContainerFactoryPluginInterf ...@@ -99,6 +99,9 @@ class Http extends DataFetcherPluginBase implements ContainerFactoryPluginInterf
if (!empty($this->configuration['authentication'])) { if (!empty($this->configuration['authentication'])) {
$options = array_merge($options, $this->getAuthenticationPlugin()->getAuthenticationOptions()); $options = array_merge($options, $this->getAuthenticationPlugin()->getAuthenticationOptions());
} }
if (!empty($this->configuration['request_options'])) {
$options = array_merge($options, $this->configuration['request_options']);
}
$response = $this->httpClient->get($url, $options); $response = $this->httpClient->get($url, $options);
if (empty($response)) { if (empty($response)) {
throw new MigrateException('No response at ' . $url . '.'); throw new MigrateException('No response at ' . $url . '.');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment