Fixed OPDS basic auth for android Coolreader #85
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The following issue from this forum thread is still actual fo me 4 years after:
http://www.sopds.ru/index.php/forum/razdel-predlozhenij/421-ne-avtorizuet-v-soopds-iz-coolreader
I've bumped into this issue using latest sopds from git and Coolreader from the google play market.
Looks like issue is that Coolreader does not send "Basic" keyword before actuatal base64 credentials.
I've compared data that browser sends and what Coolreader sends - and they end up in authentication = request.META differently.
In browser it is like authentication = "Basic AaaAaAaaBase64EncodedCreds"
With coolreader it is just authentication = "AaaAaAaaBase64EncodedCreds".
This causes 500 error with (auth_meth, auth_data) = authentication.split(' ',1) line in middlware.py not able to split the string.
Fix that I suggest enabled auth Coolreader, and it does not break regular auth for me.
Вот эта проблема 4хлетней давности с форума все еще похоже актуальна:
http://www.sopds.ru/index.php/forum/razdel-predlozhenij/421-ne-avtorizuet-v-soopds-iz-coolreader
Я воспроизвел ее с обычным Coolreaderом из гугломаркета и sopds из гита, на совершенно чистой новой машине. Суть в том, что Coolreader шлет только base64 строку с логином и паролем, а слово Basic не шлет. Фикс который я предлагаю - порешал для меня это проблему.