8000 Ultimate don't set correct content-type in some case · Issue #193 · dimdenGD/ultimate-express · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Ultimate don't set correct content-type in some case #193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cesco69 opened this issue May 9, 2025 · 0 comments · Fixed by #200
Closed

Ultimate don't set correct content-type in some case #193

cesco69 opened this issue May 9, 2025 · 0 comments · Fixed by #200

Comments

@cesco69
Copy link
Contributor
cesco69 commented May 9, 2025

Hi, in some case ultimate-express return text/html for application/octet-stream (like express). See this snippet

// must support body reading with different limits

const express = require("ultimate-express");

const app = 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');

    const ab = new ArrayBuffer(1024 * 1024 * 10);
    const u8 = new Uint8Array(ab);

    for(let i = 0; i < u8.length; i++) {
        u8[i] = i % 256;
    }

    const response = await fetch('http://localhost:13333/abc', {
        method: 'POST',
        body: ab,
        headers: {
            'Content-Type': 'application/octet-stream'
        }
    });

    const text = await response.arrayBuffer();
    console.log(response.headers.get('content-type')); // Add this check! <----------------------------------------------
    console.log(text);

    process.exit(0);

});

output

  +   'text/html; charset=utf-8\n' +
  -   'application/octet-stream\n' +
Sign up for free 4863 to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant
0