mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
feat: added support for customUserAgent (#2825)
This commit is contained in:
@@ -119,9 +119,12 @@ export default (ctx: GraphContext) => ({
|
||||
// This typecast is needed because the custom `ms` format does not return
|
||||
// the desired `number` type even though that's the only type it can
|
||||
// output.
|
||||
scraper.scrape(url, (ctx.config.get(
|
||||
"scrape_timeout"
|
||||
) as unknown) as number)
|
||||
scraper.scrape(
|
||||
url,
|
||||
(ctx.config.get("scrape_timeout") as unknown) as number,
|
||||
ctx.tenant.stories.scraping.customUserAgent,
|
||||
ctx.tenant.stories.scraping.proxyURL
|
||||
)
|
||||
),
|
||||
{
|
||||
// Disable caching for the DataLoader if the Context is designed to be
|
||||
|
||||
@@ -1150,6 +1150,12 @@ type StoryScrapingConfiguration {
|
||||
the [proxy-agent](https://www.npmjs.com/package/proxy-agent) package.
|
||||
"""
|
||||
proxyURL: String
|
||||
|
||||
"""
|
||||
customUserAgent when specified will override the user agent used by fetch
|
||||
requests made during the scraping process.
|
||||
"""
|
||||
customUserAgent: String
|
||||
}
|
||||
|
||||
"""
|
||||
@@ -3519,6 +3525,12 @@ input StoryScrapingConfigurationInput {
|
||||
the [proxy-agent](https://www.npmjs.com/package/proxy-agent) package.
|
||||
"""
|
||||
proxyURL: String
|
||||
|
||||
"""
|
||||
customUserAgent when specified will override the user agent used by fetch
|
||||
requests made during the scraping process.
|
||||
"""
|
||||
customUserAgent: String
|
||||
}
|
||||
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user