You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+49Lines changed: 49 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -771,6 +771,55 @@ Logs are also viewable in Parse Dashboard.
771
771
772
772
**Want new line delimited JSON error logs (for consumption by CloudWatch, Google Cloud Logging, etc)?** Pass the `JSON_LOGS` environment variable when starting `parse-server`. Usage :- `JSON_LOGS='1' parse-server --appId APPLICATION_ID--masterKey MASTER_KEY`
773
773
774
+
## Cloud Functions HTTP Response
775
+
776
+
Cloud functions support an Express-like `(req, res)` pattern to customize HTTP response status codes and headers.
| `res.status(code)` | Set HTTP status code (e.g., 201, 400, 404). Returns `res` for chaining. |
809
+
| `res.set(name, value)` | Set HTTP header. Returns `res` for chaining. |
810
+
811
+
### Backwards Compatibility
812
+
813
+
The `res` argument is optional. Existing cloud functions using only `(req) => {}` continue to work unchanged.
814
+
815
+
### Security Considerations
816
+
817
+
The `set()` method allows setting arbitrary HTTP headers. Be cautious when setting security-sensitive headers such as:
818
+
- CORS headers (`Access-Control-Allow-Origin`, `Access-Control-Allow-Credentials`)
819
+
- `Set-Cookie`
820
+
- `Location` (redirects)
821
+
- Authentication headers (`WWW-Authenticate`)
822
+
774
823
# Deprecations
775
824
776
825
See the [Deprecation Plan](https://github.com/parse-community/parse-server/blob/master/DEPRECATIONS.md) for an overview of deprecations and planned breaking changes.
0 commit comments