-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
req.headers is undefined #1461
Comments
Assuming you mean in Cloud Code - this is the case on Parse.com but it is a bit limiting, e.g. we currently send the user agent information as part of a request as it is unavailable in the header. The request object is not a node request object but Parse.Cloud.FunctionRequest |
Yes, but since we are not on Parse.com hosting any more im trying to understand if there is any reason not using headers in the request . |
I've anted to do something similar for ages, but until the parse server came along there wasn't a way to do it.
|
We didn't do this because we were aiming for compatibility with Parse.com. It seems like there is interest, though, and I don't see any reason not to add it. |
Any updates on this? I think it's really vital to allow access to the request's headers from Cloud Code. |
+1 |
+1 |
@greggmojica this has already been implemented 👍 |
@tarekskr I actually just saw that. My bad. Thanks!! |
@tarekskr the fix posted for #1461 doesn't appear to be true for Triggers. I see the code that adds this for Functions, but the method that headers would be injected for Triggers (before/afterSave, etc) is much more involved and I've spent several hours digging through code to try to find the place to put this in, so if you see a clear path, please provide guidance or help. thx. |
@crifkin sorry for the late response. Yes it needs more work to be able to forward the request headers to the hooks. I've prioritized it and we should be able to do something for that. |
@flovilmart I can take this issue, we have a working solution on our local branch and wouldn't take too long to create a pull request |
@miguel-s feel free to do so! I’ll review the Pr! |
Closing as PR is merged stay tuned for next release |
Hi All,
Any reason why the req.headers is undefined, we would love to get the request IP and it seems impossible without the headers, I tried search the code and the headers are been overwrite, any specific reason for that?
Thanks.
The text was updated successfully, but these errors were encountered: