Merge pull request #269 into master

bf235ee5 container: finance: fetch: prices: add User-Agent (Aaron Fiore)
eb7f97a0 container: finance: fetch: add API_VERSION to env (Aaron Fiore)
This commit is contained in:
2026-01-15 10:17:42 -08:00
2 changed files with 4 additions and 2 deletions

View File

@@ -2,7 +2,7 @@
// docker-finance | modern accounting for the power-user
//
// Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
// Copyright (C) 2021-2026 Aaron Fiore (Founder, Evergreen Crypto LLC)
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -67,6 +67,7 @@ namespace dfi
$env = new utils\Env();
// Fetch (API)
$env->set_env('API_VERSION', getenv('DOCKER_FINANCE_VERSION')); // API version
$env->set_env('API_FETCH_TYPE', strtolower($argv[1])); // API type
$env->set_env('API_FETCH_SUBTYPE', strtolower($argv[2])); // API subtype
$env->set_env('API_FETCH_YEAR', getenv('API_FETCH_YEAR')); // API year (to fetch)

View File

@@ -2,7 +2,7 @@
// docker-finance | modern accounting for the power-user
//
// Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
// Copyright (C) 2021-2026 Aaron Fiore (Founder, Evergreen Crypto LLC)
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -154,6 +154,7 @@ namespace dfi\prices\internal
protected function request_impl(string $url, array $header): mixed
{
$headers = array(
'User-Agent: docker-finance /' . $this->get_env()->get_env('API_VERSION'),
'Accept: application/json',
'Content-Type: application/json',
);