Giter Club home page Giter Club logo

Comments (4)

BSN4 avatar BSN4 commented on September 23, 2024 1

and thank you so much for maintaining and constantly improving this great project. Your efforts are deeply appreciated! , infact i'd like to help with sponsership

from hyper-express.

kartikk221 avatar kartikk221 commented on September 23, 2024

Hi, the Request.raw property was removed because it was very unstable and hyper-express could not guarantee that the Request.raw would not throw a uWS forbidden access exception. However, I will add it back with more documentation and warning that this property should not be used in production and If it is, should be used through a synchronous middelware that is bounded as soon as possible to reduce the chances of a uWS forbidden access exception.

With that said, Request.raw has been added back in version 6.7.1 be sure to upgrade to be able to access it again.

from hyper-express.

kartikk221 avatar kartikk221 commented on September 23, 2024

Also, If you don't mind, could you provide your code snippet of how you are using the raw property? I just wanna make sure It isn't something hyper-express can add to prevent you from having to drop down to the raw property.

from hyper-express.

BSN4 avatar BSN4 commented on September 23, 2024

here is the code being used as static file server ..

import { createBrotliCompress, createGzip, createDeflate } from 'zlib';
import {HttpRequest, HttpResponse} from "uWebSockets.js";

export function sendFile(res: Response, req: Request, path: string) {
    const s = res.raw as HttpResponse
    const q = req.raw as HttpRequest
    sendFileToRes(
        s,
        {
            'if-modified-since': q.getHeader('if-modified-since'),
            range: q.getHeader('range'),
            'accept-encoding': q.getHeader('accept-encoding')
        },
        path
    );
}```

// on webserver.get sync callback i return sendFile

from hyper-express.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.