Giter Club home page Giter Club logo

Comments (3)

khuezy avatar khuezy commented on July 28, 2024 1

Clients and servers are suppose to handle either casing right? But in general, they should be pascal casing. Can you figure out where/what is setting it to the lower case location and fix that? If that's somewhere upstream, then we should delete it from the resHeaders to remove the duplication.

from open-next.

r34son avatar r34son commented on July 28, 2024

if (res.statusCode >= 300 && res.statusCode < 400) {
const location = result.response.headers
.get("location")
?.replace("http://localhost:3000", `https://${req.headers.host}`);
// res.setHeader("Location", location);
return {
body: "",
type: internalEvent.type,
statusCode: res.statusCode,
headers: {
...resHeaders,
Location: location ?? "",
},
isBase64Encoded: false,
};
}

Here resHeaders contain location key. It's strange that you get location header and assign it to Location key.
I can open a PR that fixes this behavior, if you approve that it's real issue.

from open-next.

r34son avatar r34son commented on July 28, 2024

It breaks app, because by design 2 same http headers are combined in one, values in which are separated by commas. https://www.rfc-editor.org/rfc/rfc9110.html#name-field-lines-and-combined-fi

Also realised that header names are lowercase in https://developer.mozilla.org/en-US/docs/Web/API/Headers
image

I'll open pr that changes Location to location.

from open-next.

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.