diff options
author | PiBa-NL <pba_2k3@yahoo.com> | 2016-12-28 12:51:23 +0100 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-01-04 14:08:49 -0200 |
commit | 6b680dacd66d83ce140563f4d753e8404681f88b (patch) | |
tree | e2aee884fbb6f57e37f2b31250d5ac8677f4ea22 /src | |
parent | 8323e1d72b84283bd6d5cd76d58ce32e7d3c0e09 (diff) | |
download | pfsense-6b680dacd66d83ce140563f4d753e8404681f88b.zip pfsense-6b680dacd66d83ce140563f4d753e8404681f88b.tar.gz |
dyndns.class, fix json curl body parsing for Cloudflare by not including headers
(cherry picked from commit 15dcf1320c08eb9339eda3e6fdf04599c51694b7)
Diffstat (limited to 'src')
-rw-r--r-- | src/etc/inc/dyndns.class | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/etc/inc/dyndns.class b/src/etc/inc/dyndns.class index 334dadd..6b78402 100644 --- a/src/etc/inc/dyndns.class +++ b/src/etc/inc/dyndns.class @@ -393,8 +393,7 @@ curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); } - if ($this->_dnsService != 'ods' and $this->_dnsService != 'route53 ') { - curl_setopt($ch, CURLOPT_HEADER, 1); + if ($this->_dnsService != 'ods') { curl_setopt($ch, CURLOPT_USERAGENT, $this->_UserAgent); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_INTERFACE, 'if!' . $realparentif); @@ -809,7 +808,6 @@ $server = 'https://api.dnsimple.com/v1/domains/'; $token = $this->_dnsUser . ':' . $this->_dnsPass; $jsondata = '{"record":{"content":"' . $this->_dnsIP . '","ttl":"' . $this->_dnsTTL . '"}}'; - curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Content-Type: application/json', 'X-DNSimple-Token: ' . $token)); curl_setopt($ch, CURLOPT_URL, $server . $this->_dnsHost . '/records/' . $this->_dnsZoneID); @@ -856,6 +854,7 @@ break; } if ($this->_dnsService != 'ods') { + curl_setopt($ch, CURLOPT_HEADER, 1); $response = curl_exec($ch); $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); $header = substr($response, 0, $header_size); @@ -869,7 +868,7 @@ * Private Function (added 12 July 2005) [beta] * Retrieve Update Status */ - function _checkStatus($ch, $data) { + function _checkStatus($ch, $data, $header) { if ($this->_dnsVerboseLog) { log_error(sprintf(gettext('Dynamic DNS %1$s (%2$s): _checkStatus() starting.'), $this->_dnsService, $this->_FQDN)); } |