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

ocis returns text/plain content-type not application/json like oc10 when requesting with ?format=json #1779

Closed
saw-jan opened this issue Mar 9, 2021 · 2 comments · Fixed by cs3org/reva#1750

Comments

@saw-jan
Copy link
Member

saw-jan commented Mar 9, 2021

Describe the bug

When requesting with ?format=json query param, ocis returns text/plain content-type
But oC10 returns application/json

requests:

  • get capabilities
  • get share recipients

In oCIS

curl -XGET -u admin:admin https://localhost:9200/ocs/v1.php/cloud/capabilities\?format=json -v
> GET /ocs/v1.php/cloud/capabilities?format=json HTTP/1.1
> Host: localhost:9200
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.68.0
> Accept: */*
> 
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Length: 1542
< Content-Type: text/plain; charset=utf-8
< Date: Tue, 09 Mar 2021 08:10:13 GMT
< Vary: Origin
< 
{"ocs":{"meta":{"status":"ok","statuscode":100,"message":"OK"},"data":{"capabilities":{"core":{"pollinterval":60,"webdav-root":"remote.php/webdav","status":{"installed":true,"maintenance":false,"needsDbUpgrade":false,"version":"10.0.11.5","versionstring":"10.0.11","edition":"community","productname":"reva"},"support-url-signing":true},"checksums":{"supportedTypes":["sha1","md5","adler32"],"preferredUploadType":"SHA1"},"files":{"privateLinks":false,"bigfilechunking":false,"undelete":true,"versioning":true,"favorites":false,"blacklisted_files":[],"tus_support":{"version":"1.0.0","resumable":"1.0.0","extension":"creation,creation-with-upload","max_chunk_size":0,"http_method_override":""}},"dav":{"chunking":"","trashbin":"1.0","reports":["search-files"],"chunkingParallelUploadDisabled":false},"files_sharing":{"api_enabled":true,"resharing":true,"group_sharing":true,"auto_accept_share":true,"share_with_group_members_only":true,"share_with_membership_groups_only":true,"search_min_length":3,"default_permissions":22,* Connection #0 to host localhost left intact
"user_enumeration":{"enabled":true,"group_members_only":true},"federation":{"outgoing":true,"incoming":true},"public":{"enabled":true,"send_mail":true,"social_share":true,"upload":true,"multiple":true,"supports_upload_only":true,"password":{"enforced_for":{"read_only":true,"read_write":true,"upload_only":true},"enforced":true},"expire_date":{"enabled":false}},"user":{"send_mail":true}},"notifications":{"ocs-endpoints":["disable"]}},"version":{"major":10,"minor":0,"micro":11,"string":"10.0.11","edition":"reva"}}}}%

In oC10

curl -XGET -u admin:admin http://localhost/core/ocs/v1.php/cloud/capabilities\?format=json -v
> GET /core/ocs/v1.php/cloud/capabilities?format=json HTTP/1.1
> Host: localhost
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.68.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Date: Tue, 09 Mar 2021 08:09:40 GMT
< Server: Apache/2.4.41 (Ubuntu)
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 0
< X-Robots-Tag: none
< X-Frame-Options: SAMEORIGIN
< X-Download-Options: noopen
< X-Permitted-Cross-Domain-Policies: none
< Set-Cookie: ocd3fn3x61nb=qebh3979694mp7lmebkvdibjcu; path=/core; HttpOnly
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-cache, no-store, must-revalidate
< Pragma: no-cache
< Set-Cookie: oc_sessionPassphrase=uzNA6qI4ZdL1bL1S5DnbZl4d26aZ7fAZMnQ8RhpQnKzVKabauuKmdSUrSXqXdKq61mMigX8sSemXgBdXLqEslttd7ARSifpMvQ7d89DqQvLT2Y03ccsm%2FmdjEb64yzcK; path=/core; HttpOnly; SameSite=strict
< Content-Security-Policy: default-src 'none';manifest-src 'self';script-src 'self' 'unsafe-eval';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self';connect-src 'self';media-src 'self'
< Set-Cookie: ocd3fn3x61nb=69enh3cgsepffrk42tddvi9c0t; path=/core; HttpOnly
< Set-Cookie: cookie_test=test; expires=Tue, 09-Mar-2021 09:09:40 GMT; Max-Age=3600
< Content-Length: 1961
< Content-Type: application/json; charset=utf-8
< 
{"ocs":{"meta":{"status":"ok","statuscode":100,"message":"OK","totalitems":"","itemsperpage":""},"data":{"version":{"major":10,"minor":7,"micro":0,"string":"10.7.0beta1","edition":"Community"},"capabilities":{"core":{"pollinterval":60,"webdav-root":"remote.php\/webdav","status":{"installed":true,"maintenance":false,"needsDbUpgrade":false,"version":"10.7.0.0","versionstring":"10.7.0beta1","edition":"Community","productname":"ownCloud","hostname":"JT101"},"support-url-signing":true},"checksums":{"supportedTypes":["SHA1"],"preferredUploadType":"SHA1"},"files":{"privateLinks":true,"privateLinksDetailsParam":true,"bigfilechunking":true,"blacklisted_files":[".htaccess"],"favorites":true,"file_locking_support":true,"file_locking_enable_file_action":false,"undelete":true,"versioning":true},"dav":{"chunking":"1.0","reports":["search-files"],"trashbin":"1.0"},"files_sharing":{"api_enabled":true,"public":{"enabled":true,"password":{"enforced_for":{"read_only":false,"read_write":false,"upload_only":false,"read_write_dele* Connection #0 to host localhost left intact
te":false},"enforced":false},"roles_api":true,"expire_date":{"enabled":false},"send_mail":false,"social_share":true,"upload":true,"multiple":true,"supports_upload_only":true,"defaultPublicLinkShareName":"Public link"},"user":{"send_mail":false,"expire_date":{"enabled":false}},"group":{"expire_date":{"enabled":false}},"remote":{"expire_date":{"enabled":false}},"resharing":true,"group_sharing":true,"auto_accept_share":true,"share_with_group_members_only":false,"share_with_membership_groups_only":false,"can_share":true,"user_enumeration":{"enabled":true,"group_members_only":false},"default_permissions":31,"providers_capabilities":{"ocinternal":{"user":["shareExpiration"],"group":["shareExpiration"],"link":["shareExpiration","passwordProtected"]},"ocFederatedSharing":{"remote":["shareExpiration"]}},"federation":{"outgoing":true,"incoming":true},"search_min_length":2},"notifications":{"ocs-endpoints":["list","get","delete"]}}}}}%
@saw-jan saw-jan changed the title ocis returns text/plain content-type not application/json like oc10 when requesting with ?format=json ocis returns text/plain content-type not application/json like oc10 when requesting capabilities with ?format=json Mar 9, 2021
@saw-jan saw-jan changed the title ocis returns text/plain content-type not application/json like oc10 when requesting capabilities with ?format=json ocis returns text/plain content-type not application/json like oc10 when requesting with ?format=json Mar 9, 2021
@saw-jan
Copy link
Member Author

saw-jan commented Mar 10, 2021

ToDo QA-team:

  • adjust owncloud-sdk tests related to this issue

@stale
Copy link

stale bot commented May 9, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

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 a pull request may close this issue.

1 participant