GithubHelp home page GithubHelp logo

Comments (4)

SaltyAom avatar SaltyAom commented on June 10, 2024 3

Fixed on a4d74d5, published on 1.0.19

from elysia.

bogeychan avatar bogeychan commented on June 10, 2024 1

In addition to redirecting, this bug also occurs when returning raw Response objects:

import { Elysia } from "elysia";

new Elysia()
  .get("/", () => "yay")
  .get("/redirect", ({ cookie: { name, name2 }, set }) => {
    name.value = 'value'
    name2.value = 'value2'

    return new Response('yay')
  })
  .listen(8080);

from elysia.

bogeychan avatar bogeychan commented on June 10, 2024

@SaltyAom, the main cause is that this function returns a Headers object:

export const parseSetCookies = (headers: Headers, setCookie: string[]) => {

elysia/src/handler.ts

Lines 152 to 153 in 968650b

set.headers = parseSetCookies(
new Headers(set.headers) as Headers,

which cannot be used in such a spreading operation:

const inherits = { ...set.headers }

inherits is allways {}


Is this parsing step even needed?

from elysia.

doroved avatar doroved commented on June 10, 2024

Fixed on a4d74d5, published on 1.0.19

I checked the solution to my problem + #637 (comment), it's ok, thanks

from elysia.

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.