builder-web/lib
rand 0f493e9b47 Removing trailing slashes (#80)
This PR solves the issue of there being both "<url>/" and "<url>" paths, that in the builder-web context shouldn't mean different things.

The slashes are now removed using a `Dream` middleware, and the request is redirected using a permanent redirect (that doesn't change the method used): https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Location

Notable changes:
* Trailing slashes from the hardcoded link urls were removed, as unneccesary redirects are then avoided.
* All links in `Views` were rewritten to be absolute instead of relative.
* As `Dream` deprecated `path` - `Utils.Path` was created containing some helpers for manipulating paths. *Note that `String.split_on_char` has a different semantics.*
* A blacklist `routeprefix_blacklist_when_removing_trailing_slash` was added, containing `Dream` route-prefixes to ignore.
* Only `GET` and `HEAD` requests are redirected.
* `redirect_parent` helper was rewritten using new `Utils.Path` functions to avoid brittle string manipulation + fixed the edgecase of redirecting to `/`.
* Added `Uri` dependency to make URL manipulation safer.

Co-authored-by: rand00 <oth.rand@gmail.com>
Co-authored-by: Reynir Björnsson <reynir@reynir.dk>
Reviewed-on: https://git.robur.io/robur/builder-web/pulls/80
Co-authored-by: rand <rand@r7p5.earth>
Co-committed-by: rand <rand@r7p5.earth>
2022-04-21 10:40:21 +00:00
..
authorization.ml Add an access_list to grant per-job user upload permissions 2021-06-08 14:54:23 +00:00
builder_web.ml Removing trailing slashes (#80) 2022-04-21 10:40:21 +00:00
dream_tar.ml Add .../all.tar endpoint with artifacts 2022-01-25 20:01:08 +00:00
dune Removing trailing slashes (#80) 2022-04-21 10:40:21 +00:00
model.ml builder-web: Added --cachedir CLI arg for staging new vizs 2022-03-29 22:27:24 +02:00
model.mli builder-web: Added --cachedir CLI arg for staging new vizs 2022-03-29 22:27:24 +02:00
utils.ml Removing trailing slashes (#80) 2022-04-21 10:40:21 +00:00
views.ml Removing trailing slashes (#80) 2022-04-21 10:40:21 +00:00