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

Ability to set Headers for function.call #95

Closed
NickFranceschina opened this issue Jan 17, 2018 · 5 comments
Closed

Ability to set Headers for function.call #95

NickFranceschina opened this issue Jan 17, 2018 · 5 comments

Comments

@NickFranceschina
Copy link

implementing the "authorized http function endpoint" example and realizing I can't set headers when calling rsf.functions.call(...)

https://github.com/firebase/functions-samples/tree/master/authorized-https-endpoint

I can do a normal fetch for now

@n6g7
Copy link
Owner

n6g7 commented Jan 17, 2018

Hi @NickFranceschina,

That's good feedback, thanks.

I think this can easily be addressed by duplicating the fetch() api and adding an optional init parameter to the functions.call method. We'd pass this parameter down as is to fetch and we could write a custom function call like so:

yield call(rsf.functions.call, 'myFunction', {
  param1: 1,
  param2: 2
}, {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <token>'
  }
})

What do you think?

@NickFranceschina
Copy link
Author

sounds perfect! I would have offered a PR but I'm so swamped right now!!

@n6g7
Copy link
Owner

n6g7 commented Jan 18, 2018

No problem, I'll do that this weekend if we don't get a PR before then. :)

@n6g7
Copy link
Owner

n6g7 commented Jan 21, 2018

@NickFranceschina I released v0.10.0 with this new argument, let me know if it solves your problem. :)

@n6g7 n6g7 closed this as completed Jan 21, 2018
@NickFranceschina
Copy link
Author

very cool thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants