-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App not loading when accessed without trailing / #765
Comments
I actually noticed this myself just recently. I did some testing but couldn't find out a way to fix it. If I remember correctly, I managed to make some hack which would have solved the situation on Firefox but it did not work on Chrome. Any good ideas are welcome :). |
This is where the error comes from: music/js/vendor/restangular/dist/restangular.js Line 1152 in 068c5f8
I checked the network tab and I see a problem here: Without trailing "/":
With trailing "/":
It seems that the request url is not created correctly and the part after the last "/" is omitted and then appended with api/prepare_collection. |
Thanks for digging. I did notice earlier that the API calls were malformed. But what I didn't realize was that this was in fact the only problem. I thought that the routing of the AngularJS page would be broken when the address looked like "https://example.nextcloud.com/apps/music#/", and I tried to use redirection to make it look like "https://example.nextcloud.com/apps/music/#/". But this was a false assumption, in fact it doesn't matter that the address looks funny. The only important thing is that the base address of the RESTAngular library has to be set properly, to enable correctly formed API calls. I still need to work out some details on how to set the base address so that it certainly works on all kinds of server configurations. But this shouldn't be a major obstacle, so the issue should get fixed for the next Music app release. |
If there was no trailing slash, the RESTAngular library assumed that the last part in the URL 'music' was not part of the base URL. When we then changed the base URL for RESTAngular using relative path 'api', it ended up to be like '<serve_domain>/nextcloud/index.php/apps/api' instead of '<serve_domain>/nextcloud/index.php/apps/music/api'. Fixed by setting the complete path to RESTAngular, e.g. `/nextcloud/index.php/apps/music/api`. refs #765
This has been fixed in the Music app release v0.15.0. |
When the app is accessed by the url "https://example.nextcloud.com/apps/music", the app keeps loading without finishing and the following appears in the console:
Also, the url is now showing "https://example.nextcloud.com/apps/music#/".
When the app is accessed with the first url, but including a trailing "/", everything works fine. All other apps in nextcloud work fine either with or without trailing "/".
The text was updated successfully, but these errors were encountered: