You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5e17e46
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CHANGELOG.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,33 @@
1
1
# Change Log
2
2
3
+
## 0.1.3
4
+
5
+
### Added
6
+
7
+
- Opt-in HTTP protocol version: the constructor takes a trailing `?string $httpVersion` (for example `'2.0'`) that is applied to every request with `withProtocolVersion()`, so curl based PSR-18 clients such as Guzzle and php-http/curl-client negotiate HTTP/2. `null` (the default) leaves the version to the request factory.
8
+
- README section "Connection reuse and HTTP/2": reuse one `Ipdata` and one PSR-18 client per process to keep the HTTPS connection alive.
9
+
- Documentation and tests for the new API response fields: top-level `is_satellite` and `is_anycast` (present only when `true`) and `first_seen`, `last_seen` (`YYYY-MM-DD`, UTC) and `days_seen` on `threat.blocklists` entries (absent for some feeds). The client passes them through unchanged.
10
+
11
+
### Fixed
12
+
13
+
- The `$httpClient` and `$requestFactory` constructor parameters are declared explicitly nullable (`?ClientInterface`, `?RequestFactoryInterface`); PHP 8.4 deprecates implicitly nullable parameters.
14
+
15
+
## 0.1.2
16
+
17
+
### Added
18
+
19
+
-`lookup()` without arguments looks up the IP address of the caller.
20
+
-`Ipdata::EU_BASE_URL` and a trailing `$baseUrl` constructor argument to route requests through ipdata's EU endpoint (eu-api.ipdata.co).
21
+
-`bulkLookup()`; `buildLookup()` is kept as a deprecated alias.
22
+
23
+
### Fixed
24
+
25
+
- Bulk requests are sent with `Content-Type: application/json` instead of `text/plain`.
26
+
27
+
### Removed
28
+
29
+
- Unused dev dependencies `php-http/httplug` and `symfony/http-client`.
* The PSR-18 API is synchronous, one request at a time, so HTTP/2 multiplexing brings nothing here: the saving is
222
+
the TLS handshake on every call after the first.
223
+
* PHP runs one request per process, so there is no thread-safety concern. After `pcntl_fork()`, build a new
224
+
`Ipdata` and HTTP client in the child instead of sharing the parent's sockets.
225
+
*`Ipdata` has no `close()` method because it does not own the connections: they belong to the PSR-18 client you
226
+
injected and are closed when that client is released, at the latest when the process ends. Timeouts, proxies
227
+
and other transport settings are configured on that client as well.
228
+
182
229
## Available Fields
183
230
184
231
A list of all the fields returned by the API is maintained at [Response Fields](https://docs.ipdata.co/api-reference/response-fields)
185
232
233
+
The client returns the decoded JSON unchanged, so new fields reach you as soon as the API sends them. Recent additions:
234
+
235
+
-`is_satellite` (boolean): the IP address belongs to a satellite internet provider. Present only when `true`; the key is omitted otherwise, so read it as `$data['is_satellite'] ?? false`.
236
+
-`is_anycast` (boolean): the IP address is an anycast address announced from several locations. Present only when `true`; read it as `$data['is_anycast'] ?? false`.
237
+
-`threat.blocklists[].first_seen` (string, `YYYY-MM-DD`, UTC): the first day the address appeared on that blocklist.
238
+
-`threat.blocklists[].last_seen` (string, `YYYY-MM-DD`, UTC): the most recent day the address appeared on that blocklist.
239
+
-`threat.blocklists[].days_seen` (integer): the number of days the address has been seen on that blocklist.
240
+
241
+
Some feeds, for example ipdata's own vpn feed, carry none of the three blocklist date fields, so read them as `$entry['first_seen'] ?? null`. The dates are passed through as strings; the client does not parse them. `is_satellite` and `is_anycast` can also be requested through the `$fields` argument of `lookup()` and `bulkLookup()`.
242
+
186
243
## Errors
187
244
188
245
A list of possible errors is available at [Status Codes](https://docs.ipdata.co/api-reference/status-codes)
0 commit comments