mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-03 04:40:09 +00:00
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:
@@ -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 },
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user