Skip to content

Conversation

@mathu97
Copy link
Collaborator

@mathu97 mathu97 commented Feb 24, 2025

Update NextJS Adapter to:

  1. Add x-fah-adapter header that indicates adapter name + version
    • Modifies the compiled route-manifest.json file in the standalone folder to add x-fah-adapter header.
  2. Add x-fah-middleware header for apps that have a middleware.
    • Reades the compiled middleware-manifest.json file to check if there are any middlewares used by the app, and updates the route-manifest.json file to add x-fah-middleware header.

Manual Testing:

  • Next 15 with app router
  • Next 14 with app router
  • Next 13 with app router
  • Next 15 with pages router
  • Next 14 with pages router
  • Next 13 with pages router

Depends on #305

@mathu97 mathu97 marked this pull request as ready for review February 25, 2025 21:02
@mathu97 mathu97 requested a review from annajowang February 25, 2025 21:11
key: "x-fah-adapter",
value: `nextjs-${adapterMetadata.adapterVersion}`,
},
...(middlewareExists(middlewareManifest)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we be adding a separate x-fah-middleware header entry for each of the middleware matchers?

Copy link
Collaborator Author

@mathu97 mathu97 Feb 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's what we eventually want to do. I believe we agreed for now that we'll add this header if there is a middleware at all.

@mathu97 mathu97 requested a review from Yuangwang February 26, 2025 20:53
@mathu97 mathu97 requested a review from jamesdaniels February 27, 2025 00:46
@mathu97 mathu97 merged commit aa0c4ed into main Feb 27, 2025
10 checks passed
@mathu97 mathu97 deleted the feat/custom-apphosting-headers branch February 27, 2025 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants