Skip to content

Commit adef92f

Browse files
Apply suggestions from code review
Fix typos and other errors in the code as suggested by review process Co-authored-by: Kate <[email protected]> Signed-off-by: Christian Wolf <[email protected]>
1 parent d5f5e94 commit adef92f

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

developer_manual/basics/controllers.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -765,12 +765,12 @@ To use OCS in your API you can use the **OCP\\AppFramework\\OCSController** base
765765
}
766766
767767
For ``OCSController`` classes and their methods, :ref:`responders <controller-responders>` can be registered as with any other ``Controller`` method.
768-
The ``OCSController`` class have however automatically two respo nders pre-installed:
768+
The ``OCSController`` class have however automatically two responders pre-installed:
769769
Both JSON (``application/json``) and XML (``text/xml``) are generated on-the-fly depending on the request by the browser/user.
770-
To select the output format, the format parameter or the ``Accept`` header of the request work out of the box, no intervention is required.
770+
To select the output format, the `?format=` query parameter or the ``Accept`` header of the request work out of the box, no intervention is required.
771771
It is advised to prefer the header generally, as this is the more programmatic way.
772772

773-
In order to make routing work for OCS routes you need to add a separate 'ocs' entry to the routing table in ``appinf/routes.php`` of your app.
773+
In order to make routing work for OCS routes you need to add a separate 'ocs' entry to the routing table in ``appinfo/routes.php`` of your app.
774774
Inside these are normal routes.
775775

776776
.. code-block:: php

developer_manual/digging_deeper/rest_apis.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ The following combinations of attributes might be relevant for various scenarios
9494

9595
#. Plain frontend route: ``Controller`` class
9696
#. Plain frontend with CRSF checks disabled: ``Controller`` class and ``#[NoCSRFRequired]`` attribute on the method
97-
#. REST route with CORS enabled: ``Controller`` class and ``#[CORS]`` and ``#[NoCSRFRequired]`` attributes on the route
98-
#. OCS-based route: ``OCSController`` class
99-
#. OCS-based route with CORS enabled: ``OCSController`` class and ``#[CORS]`` attribute on the method
97+
#. Plain frontend route with CORS enabled: ``Controller`` class and ``#[CORS]`` and ``#[NoCSRFRequired]`` attributes on the route
98+
#. OCS route: ``OCSController`` class
99+
#. OCS route with CORS enabled: ``OCSController`` class and ``#[CORS]`` attribute on the method
100100

101101
.. warning::
102102
Adding the ``#[NoCRSFRequired]`` attribute imposes a security risk.
@@ -114,8 +114,8 @@ These ways depend on your API configuration (what you allow) and on which route
114114
- *Access from web frontend* means the user is browses the Nextcloud web frontend with a browser.
115115
- *Access from an external app* indicates that the user is not using the normal browser (as logged in) but directly navigates a certain URL.
116116
This can be in a new browser tab or an external program (like an Android app or simply a curl command line).
117-
- *Access from external website* means that the user browses some third party web site and *magically* data from your app appears.
118-
Technically, the other website would embed/load/use images, JSON data, or other resources from a URL pointing to the Nextcloud server.
117+
- *Access from external website* means that the user browses some third party web site and data from your Nextcloud server appears.
118+
The other website has to embed/load/use images, JSON data, or other resources from a URL pointing to the Nextcloud server, to be able to do this.
119119

120120
.. list-table:: Comparison of different API types
121121
:header-rows: 1
@@ -170,6 +170,6 @@ The only exception to this is if you want to provide an API for external usage w
170170
Here, the encapsulation introduced in OCS and CSRF checks might be in your way.
171171

172172
.. [#] Only if you have set ``#[NoCSRFRequired]``.
173-
OCS controllers have other CSRF checks in place that might with CORS without disabling the CSRF checks completely.
174-
Using the ``OCS-APIREQUEST`` header is also a CSRF protection but is compatible with CORS.
175-
.. [#] The OCS controller needs the request header ``OCS-APIREQUEST`` to be set to ``true``.
173+
OCS controllers have other CSRF checks in place that work with CORS without disabling the CSRF checks completely.
174+
Using the ``OCS-APIRequest`` header is a CSRF protection which is compatible with CORS.
175+
.. [#] The OCS controller needs the request header ``OCS-APIRequest`` to be set to ``true``.

0 commit comments

Comments
 (0)