Skip to content

Next.config.ts redirects produces decoded Location header #940

@leog

Description

@leog

When configuring next.config.ts redirects as follows, and you visit /about?param=test%2F%2F the resultant Location header has the query parameter decoded, which produces an error in Cloudfront.

This worked correctly up until v3.5.5 according to my research, from v3.5.6 onwards this is reproducible, including v3.7.2. Also tested v3.6.3 which includes #871, directly tackling this issue, but no luck.

import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  async redirects() {
    return [
      {
        source: "/about",
        destination: "/",
        permanent: false,
      },
    ];
  },
};

export default nextConfig;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions