Can not add sources if url does not end with a slash #184
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
If you log in entering the url without a final slash, the login correctly works. However, the url is considered invalid when attempting to add sources.
Steps to Reproduce
Expected behavior: You should be able to add sources anyway.
I couldn't reproduce. Are you sure the issue isn't with the selfoss api ?
Strange, I was able to reproduce this on my physical device and on emulated devices with API 25, 34 and 35.
I'm running Selfoss 2.19 stable, but I reckon I do not have a second instance running to test this on. No API call appears to take place, thus I'd exclude it is a problem on server side.
Looking here it appears that urls without a final slash should not even be allowed to log in at all:
However, I am able to log in. When attempting to add a source I receive the error message "Log in to add sources." in a toast. The client has correctly done the login since I am able to use the application normally and my selfoss instance does not allow guest access.
this.toHttpUrlOrNull()
returns the url with a slash.Can you provide a screengrab of the error, please?
Here you go, right after tapping the button to add a source I am redirected to the home and the toast appears.
The
isBaseUrlInvalid
is called on the login screen, so the result should be the same on the sources screen too.This isn't an issue with the url.
I'll close for now. Please reopen if you have more details.
So, I went through both checks with the debugger.
isBaseUrlInvalid
does return true in both cases when you use a url without a final slash. However in the login process, that does not stop the login attempt. Login is successful and thus you proceed to the home page. In the source adding page, if the base url is considered invalid then it immediately kicks you out without attempting to perform any operation.It is supposedly a bit strange, because this is the only place in the application where we check the validity of the url after we already did log in. I'm not really sure the check itself is necessary and may be removed altogether from the sources. I think the check is meant to ensure we actually did log in and are not connected as a guest, but that is not really what it is doing.
Alternatively we may stop considering as invalid urls who do not end with a slash, as these appear to be perfectly valid for all other operations.
Thanks for the details. I fixed the issue.