Centralize and standardize User-Agent string

Introduce a centralized RMAB_USER_AGENT constant (ReadMeABook/<version>) and update audible service calls to use it instead of hardcoded values. This avoids the default axios UA (which some indexers reject) and replaces the previous `rmab/` identifier. Adds unit tests to verify the User-Agent format and ensure it doesn't resemble generic bot signatures.
This commit is contained in:
kikootwo
2026-05-18 09:45:57 -04:00
parent a2d25e8a39
commit fb0445d95f
3 changed files with 24 additions and 3 deletions
+2 -2
View File
@@ -677,7 +677,7 @@ export class AudibleService {
{
params: { region: audnexusRegion },
timeout: 10000,
headers: { 'User-Agent': 'ReadMeABook/1.0' },
headers: { 'User-Agent': RMAB_USER_AGENT },
},
);
@@ -768,7 +768,7 @@ export class AudibleService {
{
params: { region: audnexusRegion },
timeout: 5000,
headers: { 'User-Agent': 'ReadMeABook/1.0' },
headers: { 'User-Agent': RMAB_USER_AGENT },
},
);