Skip to content
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

fixed ocs function for Group Folders app routes #279

Merged
merged 1 commit into from
Jul 30, 2024
Merged

Conversation

bigcat88
Copy link
Contributor

@bigcat88 bigcat88 commented Jul 30, 2024

Fixes #277 .

Changes proposed in this pull request:

  • we use request.headers["Accept"] = "application/json" in addition of appending format=json to the query url(look below why).
  • changed ocs_regexp to r"/ocs/v[12]\.php/|/apps/groupfolders/" until groupfolder app will fix it.

@bigcat88
Copy link
Contributor Author

Note for future:
Nextcloud 30 does not respect Accept: application/json header when exception occurs and output xml, that's why I didn't remove request.url = request.url.copy_merge_params({"format": "json"}) line from _session.py

image

https://docs.nextcloud.com/server/latest/developer_manual/server/externalapi.html#output

Copy link

codecov bot commented Jul 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.13%. Comparing base (e56e324) to head (86ac367).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #279   +/-   ##
=======================================
  Coverage   94.13%   94.13%           
=======================================
  Files          48       48           
  Lines        5492     5494    +2     
=======================================
+ Hits         5170     5172    +2     
  Misses        322      322           
Files Coverage Δ
nc_py_api/_session.py 96.47% <100.00%> (+0.02%) ⬆️

@bigcat88
Copy link
Contributor Author

will merge this and looks like it is a good idea to make API for GroupFolders as it is pretty popular

@bigcat88 bigcat88 merged commit e6d4605 into main Jul 30, 2024
19 checks passed
@bigcat88 bigcat88 deleted the fix/ocs-groupfolders branch July 30, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSONDecodeError when trying to use ocs with groupfolders
1 participant