Resolve #9: redirect to url with trailing slash
commit86d053fca2155a7efe03da1257ebc0146a64b51c
authorOleg Grenrus <oleg.grenrus@iki.fi>
dateFri 5 Aug 2016, 08:49 (10 years ago)
parent6370f35
index.html.tmpl+8
@@ -31,6 +31,14 @@
3131 <!-- <script src='lang/ru.js' type='text/javascript'></script> -->
3232 <!-- <script src='lang/en.js' type='text/javascript'></script> -->
3333
34+ <script type="text/javascript">
35+ // servant-swagger-ui: redirect to location with a trailing slash
36+ // we need this because assets are served from relative paths
37+ if (window.location.href[window.location.href.length - 1] !== '/') {
38+ window.location.href = window.location.href + '/';
39+ }
40+ </script>
41+
3442 <script type="text/javascript">
3543 $(function () {
3644 var url = window.location.search.match(/url=([^&]+)/);