rsnext/test/integration/custom-server
Aly Ahmed 19c2e197ea
fix setAssetPrefix when running on NextCustomServer (#61676)
### What?

Fixes `setAssetPrefix` when running on a custom server using next()
function

### Why?

Looks like when we run next custom server, there are 2 instances created
to handle this case

* main server in `/server/next.ts`
* and Render server `./server/lib/render-server.ts`

The issue mainly happens when calling `setAssetPrefix` it will update
only the main server and not render server

``` javascript
  const next = require('next')
  const app = next({ });
    app.setAssetPrefix('my-fancy-cdn/static');
    app.render(); // render server is used instead of the main server
```

### How?

when calling `setAssetPrefix` on the main server also update the render
server with the same information.

Fixes: #59940
Fixes: #51223 
Fixes: #61383

### Related Resources

#53523  #49805


c9c6ff6d77/docs/03-pages/01-building-your-application/06-configuring/10-custom-server.mdx

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-02-05 14:09:29 -08:00
..
pages BREAKING CHANGE: Enable newNextLinkBehavior (#41459) 2022-10-17 21:20:28 -04:00
ssh Update flakey test cases (#45290) 2023-01-25 22:55:49 -08:00
static Add test for internal url handling in render (#9396) 2019-11-12 19:52:58 -08:00
test fix setAssetPrefix when running on NextCustomServer (#61676) 2024-02-05 14:09:29 -08:00
middleware.js fix: hardcoded protocol in request url (#37925) 2022-06-24 19:31:23 -05:00
next.config.js Improve linting rules to catch more errors (#9374) 2019-11-10 19:24:53 -08:00
server.js Redesign nextjs logging (#54713) 2023-09-05 11:40:00 +00:00