1. 27 Feb, 2019 1 commit
    • Jesse Hallam's avatar
      MM-14194: fix subpath csp directive until server restart (#10365) · 4f259970
      Jesse Hallam authored
      * MM-14194: fix subpath csp directive until server restart
      The SiteURL organically doesn't take effect until server restart, but in v5.8, the required CSP directive would change immediately. If changing from one subpath to another, the webapp would effectively be bricked until a server restart.
      Avoid this by determining the CSP directive when the static handler is created.
      * simplify access to config
  2. 20 Feb, 2019 1 commit
  3. 13 Feb, 2019 1 commit
    • Jesse Hallam's avatar
      MM-14052: fix subpath yet again (#10278) · cd5d5f83
      Jesse Hallam authored
      * MM-14052: fix subpath yet again
      The server now emits a script-src directive that overrides the root.html
      rewrite. Fix this by emitting the requisite sha-256 hash server-side as
      well as rewriting root.html. We can't remove the root.html rewrite,
      since the assets may be on a CDN instead and we use the same code path
      to rewrite them (on demand).
      Prior to this change, going from / -> /subpath -> / would leave changes
      in root.html: the Content-Security-Policy header would still have the
      sha-256 hash, and the inline script would still override the publicPath
      but to the default subpath value. To avoid sending down a sha-256 hash
      server-side when no subpath is required, change this to fully strip out
      the subpath changes. This is the only unit test change, as the existing
      coverage proves the algorithm still works.
      * fix subpath concatenation in test
      path.Join isn't meant to work with a URL + path, and my test was effectively working with the subpath "/localhost:8065/subpath" instead of just "/subpath". The CI servers presumably caught this due to a different configuration than my local development.
  4. 31 Jan, 2019 1 commit
  5. 05 Dec, 2018 1 commit
  6. 03 Dec, 2018 1 commit
  7. 28 Nov, 2018 1 commit
  8. 16 Oct, 2018 1 commit
  9. 11 Jul, 2018 1 commit
    • Jesse Hallam's avatar
      MM-11241: fix context site url header (#9079) · 7c08ff99
      Jesse Hallam authored
      * fix context's SiteURLHeader to use the subpath
      This fixes various commands such as /open and /groupmsg, as well as
      OAuth related redirects.
      * MM-11246: also leverage GetSiteHeader() in completeSaml
  10. 26 Jun, 2018 1 commit
  11. 21 Jun, 2018 1 commit
    • Jesse Hallam's avatar
      MM-10370: serve subpath (#8968) · dd35ad43
      Jesse Hallam authored
      * factor out GetSubpathFromConfig
      * mv web/subpath.go to utils/subpath.go
      * serve up web, api and ws on /subpath if configured
      * pass config to utils.RenderWeb(App)?Error
      This allows the methods to extract the configured subpath and redirect
      to the appropriate `/subpath/error` handler.
      * ensure GetSubpathFromConfig returns trailing slashes deterministically
      * fix error 404 handling
      * redirect /subpath to /subpath/
      This is necessary for the static handler to match, otherwise none of the
      registered routes find anything. This also makes it no longer necessary
      to add trailing slashes in the root router.
  12. 14 Jun, 2018 1 commit
  13. 04 Jun, 2018 1 commit
  14. 01 Jun, 2018 1 commit
  15. 14 May, 2018 1 commit
    • Joram Wilander's avatar
      Refactor context out of API packages (#8755) · 47250c66
      Joram Wilander authored
      * Refactor context out of API packages
      * Update function names per feedback
      * Move webhook handlers to web and fix web tests
      * Move more webhook tests out of api package
      * Fix static handler