Commit Graph

22 Commits

Author SHA1 Message Date
Martin Kraft
2bb6071f73 MM-26065: Reverts Brotli encoding. (#14834)
* MM-26065: Reverts Brotli encoding.

* MM-26065: Removes package reference.
2020-06-16 18:15:31 -04:00
Martin Kraft
e8daab6b84 MM-25369: Disable Brotli in 'dev' mode. (#14608) 2020-05-20 19:05:21 -04:00
Martin Kraft
d7cb890f34 MM-25095: Handles static JS and CSS using Brotli encoding. (#14524)
* MM-25095: Handles static JS and CSS files using Brotli.

* MM-25095: Linting fix.

* MM-25095: Adds missing license.

* MM-25095: Moves initialization of slice.

* MM-25095: Moves initialization of slice.
2020-05-19 08:40:13 -04:00
Agniva De Sarker
a986aeb401 Remove explicit application/wasm mimetype (#13804)
Go mime sniffer supports the application/wasm mimetype natively
now. So there is no need to set this explicitly.
2020-02-05 09:06:17 +05:30
Doug Clark
7f6074b300 GH-13570 Allow /static/plugins/* endpoint responses to be cached (except for 404s) (#13592)
* Reinstate caching on /static/plugins/* endpoint except for 404s

* fix struct name and change default behavior for staticFilesHandler
2020-01-08 16:43:59 -04:00
Jesse Hallam
345b0c560a MM-20948: nocache for static plugin assets (#13322)
Serve static plugin assets with a `Cache-Control: no-cache, public` header. This avoids caching a 404 response for such an asset, preventing it from being loaded until expiry even if the file later becomes available.

This is currently preventing updates of plugins on community and would generally affect any customer with a cache in front of the Mattermost servers.

Fixes: https://mattermost.atlassian.net/browse/MM-20948
2019-12-05 23:57:30 -04:00
Jesús Espino
a63684fcb5 Consistent license message for all the go files (#13235)
* Consistent license message for all the go files

* Fixing the last set of unconsistencies with the license headers

* Addressing PR review comments

* Fixing busy.go and busy_test.go license header
2019-11-29 12:59:40 +01:00
Miguel de la Cruz
2259b7f2a8 [MM-19948] Set version on module file and internal paths (#13186)
* [MM-19948] Set version on module file and internal paths

* Fixes after merge

* Fix i18n checker error
2019-11-28 14:39:38 +01:00
ishanray
bf693b6a0c Fix typo by removing extra p in function name (#12996) 2019-11-12 15:14:57 +01:00
Nikhil Ranjan
e58aeb90a8 MM-18255 Converting to structured logging the file web/static.go (#12093)
* Converting to structured logging the file web/static.go

* change staticDir to clientDir in logs
2019-09-13 00:22:48 +08:00
Devin Binnie
9562917734 [MM-16677] New unsupported browser page (#11858)
* Added OSVersion to unsupported browser template (and some test code)

* [MM-17569] Working prototype (not functional) of unsupported browser page

* WIP

* WIP

* [MM-17571] Unsupported browser page template logic

* WIP

* [MM-17572][MM-17573] Added browsers and tested for unsupported under IE and Safari

* Clean-up

* Added missing license header

* Fixed a test

* Blank commit to force CI update

* PR feedback

* oops
2019-08-15 14:30:40 -04:00
Jesse Hallam
aca8914e35 MM-14052: Fix subpath rewrite again (#10252)
* actually log an error when subpath rewrite fails

* update subpath rewrite to accommodate dropping unsafe-eval
2019-02-11 21:21:23 -05:00
Christopher Speller
8b2ceaff8b Adding default robots.txt (#10016) 2018-12-18 08:37:42 -05:00
Christopher Speller
8429add371 Cleanup related to context refactor (#9988) 2018-12-17 08:51:46 -08:00
Christopher Speller
da265fbaf7 Moving app from singular to being created for every request (#9889)
* Moving app from singular to being created for every request.

* Automatic refactor

* Adding license header

* Feedback fixes
2018-11-28 10:56:21 -08:00
Jesse Hallam
af984b71e9 ensure subpath redirect preserves query string correctly (#9444)
The previous code appended a `/` to the end of the URL, breaking if a
query string was present.
2018-09-27 09:34:45 +02:00
Jesse Hallam
0788cdcadf MM-11420: plugins: compute bundle hash on load (#9172)
* plugins: compute bundle hash on load

Use this hash to bust client caches whenever the plugin bundle changes.

* eliminate redundant pluginHandler

* switch to 64-bit FNV-1a

* Fix test
2018-07-31 16:29:52 -04:00
Christopher Speller
82dfe9e61d Adding support for code split plugins. (#9184) 2018-07-31 07:44:44 -07:00
Joram Wilander
1c194e5fbd Fix plugins serving after subpath changes (#8982) 2018-06-22 22:09:31 -04:00
Jesse Hallam
dd35ad43ca MM-10370: serve subpath (#8968)
* 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.
2018-06-21 11:31:51 -07:00
Jesse Hallam
f106417103 MM-10367: rewrite subpath assets on startup (#8944)
Examine ServiceSettings.SiteURL on startup and rewrite assets
accordingly if not in a development environment.

Also export `mattermost config subpath` command to manually do same.

This accompanies a webapp PR to use the updated `root.html` to define
the necessary webpack asset path for dynamically loading assets.
2018-06-14 08:26:22 -07:00
Joram Wilander
47250c6629 Refactor context out of API packages (#8755)
* 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
2018-05-14 10:24:58 -04:00