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)
Thu, Jun 27, 9:13 AM
Unknown Object (File)
Sun, Jun 23, 8:15 PM
Unknown Object (File)
Fri, Jun 21, 11:58 PM
Unknown Object (File)
Fri, Jun 21, 11:58 PM
Unknown Object (File)
Fri, Jun 21, 11:57 PM
Unknown Object (File)
Fri, Jun 21, 11:40 PM
Unknown Object (File)
Fri, Jun 21, 6:18 PM
Unknown Object (File)
Wed, Jun 19, 9:42 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
Lint Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #10802)

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