Project

General

Profile

Bug #9580

Dynamic DNS DNSimple client errors

Added by Paul Sadauskas 3 months ago. Updated 17 days ago.

Status:
Feedback
Priority:
Normal
Category:
Dynamic DNS
Target version:
Start date:
06/10/2019
Due date:
% Done:

100%

Estimated time:
Affected Version:
2.4.4
Affected Architecture:

Description

It seems DNSimple recently updated their web server to use HTTP/2 for their API. The curl response handling code in the Dynamic DNS client uses a simple regex to look for ` 200 OK `, which no longer matches the success response from DNSimple.

DNSimple's API sends back a response like:

HTTP/2 200 \r\n
server: nginx
...

The response regex used to detect "success" for most clients in the DNSimple lib use this regex: /\s200\sOK/i

The php curl library has a function to extract the status code, it's probably safer to use that everywhere instead.

$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($code == "200") {
  // ...
}

Associated revisions

Revision 6c7d0571 (diff)
Added by Paul Sadauskas 3 months ago

Fix handing of DNSimple API response

It seems DNSimple started using HTTP/2, which broke the regex the dnsimple updater was using to check for success. I changed it to use the CURLINFO_HTTP_CODE instead.

I noticed several other providers are using the regex status match instead of HTTP_CODE, but I didn't touch those. I haven't written any PHP in 20 years, and I don't use those providers to test them. This change works for me for DNSimple now.

The HTTP/2 response the API was sending back (missing the "OK" the regex was looking for):

```
HTTP/2 200 \r\n
server: nginx
...
```

Fixes Ticket #9580

Revision 88a41391 (diff)
Added by Paul Sadauskas 2 days ago

Fix handing of DNSimple API response

It seems DNSimple started using HTTP/2, which broke the regex the dnsimple updater was using to check for success. I changed it to use the CURLINFO_HTTP_CODE instead.

I noticed several other providers are using the regex status match instead of HTTP_CODE, but I didn't touch those. I haven't written any PHP in 20 years, and I don't use those providers to test them. This change works for me for DNSimple now.

The HTTP/2 response the API was sending back (missing the "OK" the regex was looking for):

```
HTTP/2 200 \r\n
server: nginx
...
```

Fixes Ticket #9580

(cherry picked from commit 6c7d0571d5bf44350665c844b1d59a37ac6f972e)

History

#1 Updated by Jim Pingle 3 months ago

  • Target version set to 2.5.0

#2 Updated by Jim Pingle 24 days ago

  • Status changed from New to Pull Request Review

#3 Updated by Renato Botelho 17 days ago

  • Status changed from Pull Request Review to Feedback
  • Assignee set to Renato Botelho
  • % Done changed from 0 to 100

PR has been merged. Thanks!

Also available in: Atom PDF