You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, in some case ultimate-express return text/html for application/octet-stream (like express). See this snippet
// must support body reading with different limitsconstexpress=require("ultimate-express");constapp=express();app.use(express.json({limit: '100kb'}));app.use(express.raw({limit: '50mb'}));app.use(express.urlencoded({limit: '50mb'}));app.post('/abc',(req,res)=>{res.send(req.body);});app.listen(13333,async()=>{console.log('Server is running on port 13333');constab=newArrayBuffer(1024*1024*10);constu8=newUint8Array(ab);for(leti=0;i<u8.length;i++){u8[i]=i%256;}constresponse=awaitfetch('http://localhost:13333/abc',{method: 'POST',body: ab,headers: {'Content-Type': 'application/octet-stream'}});consttext=awaitresponse.arrayBuffer();console.log(response.headers.get('content-type'));// Add this check! <----------------------------------------------console.log(text);process.exit(0);});
Uh oh!
There was an error while loading. Please reload this page.
Hi, in some case ultimate-express return text/html for application/octet-stream (like express). See this snippet
output
The text was updated successfully, but these errors were encountered: