diff --git a/lib/index.ts b/lib/index.ts index ca769780..23de82b8 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -38,8 +38,6 @@ type File = string | Buffer | Readable; * Creates a function to be used for finding potential sources for a given image. */ const sagiri = (token: string, defaultOptions: Options = { results: 5 }) => { - const request = bent('https://saucenao.com', 'json', 'POST'); - log('Created Sagiri function with default options:', defaultOptions); return async ( @@ -100,6 +98,14 @@ const sagiri = (token: string, defaultOptions: Options = { results: 5 }) => { form.append('file', file); } + const request = bent( + 'https://saucenao.com', + 'json', + 'POST', + 200, + form.getHeaders() + ); + log('Sending request to SauceNAO'); const response = (await request('/search.php', form)) as Response; diff --git a/package.json b/package.json index 30c73805..4ee43f7c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sagiri", - "version": "3.0.0", + "version": "3.0.1", "description": "A simple, lightweight and actually good JS wrapper for the SauceNAO API.", "author": "sr229", "license": "MIT",