Page MenuHomePhabricator

[server] Factor out clientURLFromLocalURL so it can be reused in website-responders.js
ClosedPublic

Authored by ashoat on Mar 29 2022, 3:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 15, 6:07 AM
Unknown Object (File)
Sun, Nov 10, 12:12 AM
Unknown Object (File)
Sun, Nov 10, 12:12 AM
Unknown Object (File)
Sun, Nov 10, 12:06 AM
Unknown Object (File)
Fri, Nov 8, 12:43 PM
Unknown Object (File)
Fri, Nov 8, 2:55 AM
Unknown Object (File)
Tue, Nov 5, 1:24 AM
Unknown Object (File)
Oct 17 2024, 11:47 PM

Details

Summary

We're changing this logic because now that we're using Express routers directly, req.url gets the baseRoutePath for the router stripped out.

See the docs for req.originalUrl:

the “mounting” feature of app.use() will rewrite req.url to strip the mount point.

Depends on D3553

Test Plan
  1. We tested the landing page, the SquadCal app, and the Comm app
  2. We made sure we tried configs where baseRoutePath !== basePath
  3. We also checked view-source to make sure things were set correctly
  4. We made sure there were no errors in the browser console
  5. We played around with the site, logging in and navigating and making sure things worked correctly
  6. We tried loading a specific URL for a specific chat directly

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Mar 29 2022, 3:46 PM
Harbormaster failed remote builds in B7700: Diff 10802!
This revision is now accepted and ready to land.Mar 30 2022, 11:13 AM
server/src/utils/urls.js
33

what do you think about changing url to something more descriptive to indicate that the baseRoutePath has been stripped?

Sorry, I missed this feedback! Addressed in D3580