Compare commits

..

3 Commits

Author SHA1 Message Date
d587b92ea4 Messing around with http decoding
All checks were successful
Build / Build NPM Project (push) Successful in 24s
Build / Tag Version (push) Successful in 7s
2024-08-13 15:38:20 -04:00
26c6084052 Messing around with http decoding
All checks were successful
Build / Build NPM Project (push) Successful in 24s
Build / Tag Version (push) Successful in 7s
2024-08-13 15:21:56 -04:00
874bba59d3 Messing around with http decoding
All checks were successful
Build / Build NPM Project (push) Successful in 24s
Build / Tag Version (push) Successful in 7s
2024-08-13 15:19:07 -04:00
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@ztimson/utils",
"version": "0.14.7",
"version": "0.14.10",
"description": "Utility library",
"author": "Zak Timson",
"license": "MIT",

View File

@ -107,10 +107,10 @@ export class Http {
resp.data = new Response(stream);
if(opts.decode !== false) {
const content = resp.headers.get('Content-Type')?.toLowerCase();
if(content?.includes('json')) resp.data = <T>await resp.data.json();
else if(content?.includes('text')) resp.data = <T>await resp.data.text();
if(content?.includes('application')) resp.data = <T>await resp.data.blob();
else if(content?.includes('form')) resp.data = <T>await resp.data.formData();
else if(content?.includes('application')) resp.data = <T>await resp.data.blob();
else if(content?.includes('json')) resp.data = <T>await resp.data.json();
else if(content?.includes('text')) resp.data = <T>await resp.data.text();
}
if(resp.ok) res(resp);