Description
Allow for a custom handlers to be provided to the Node File System Persister for converting urls to file paths.
The use case that we have for this is so that we can hash the URL rather than creating a long path from the URL (comunica/comunica#1363 (comment)) - as the paths we are generating are too long for Windows machines which often have a MAX_PATH of ~256 chars (comunica/comunica#1363 (comment)). This could be configurable as an additional persisterOption in the setupPolly function like so:
return setupPolly({
adapters: [ NodeHttpAdapter ],
persister: FSPersister,
persisterOptions: { fs: { recordingsDir, urlToPath: (url: string) => md5(url) }},
recordFailedRequests: true,
matchRequestsBy: {
headers: {
exclude: [ 'user-agent' ],
},
},
});