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

What should we do if a launch handler reads POST data from a request but doesn't handle the launch? #17

Closed
fallaciousreasoning opened this issue May 28, 2019 · 5 comments

Comments

@fallaciousreasoning
Copy link
Collaborator

This is based on #15.

I have two main thoughts here:
a) As the launch event handler is likely to have an aggressive timeout, reading the request body is probably not a good idea - Maybe we should block reading the body?
b) However we handle this, it should match up exactly with whatever fetch does.

@raymeskhoury for input.

@raymeskhoury
Copy link
Collaborator

@jakearchibald could you explain your concerns here a bit more so we can make sure we address the issue properly?

@jakearchibald
Copy link

a) As the launch event handler is likely to have an aggressive timeout, reading the request body is probably not a good idea - Maybe we should block reading the body?

Wouldn't that prevent the share target use-case?

could you explain your concerns here a bit more

You can't typically read a request/response body twice. If the developer reads it in the launch event, how will the browser be able to read it when it makes the actual request?

@fallaciousreasoning
Copy link
Collaborator Author

fallaciousreasoning commented May 29, 2019

Wouldn't that prevent the share target use-case?

I think there's often enough information in the query string to decide what to do. But yeah, you're right, blocking reading probably isn't a great solution :/

@raymeskhoury
Copy link
Collaborator

You can't typically read a request/response body twice. If the developer reads it in the launch event, how will the browser be able to read it when it makes the actual request?

@jakearchibald interesting.

What happens in a fetch handler if you read the request body and then request() it? I guess the same thing could happen?

@raymeskhoury
Copy link
Collaborator

Oh I just noticed your answer to the same question in #15. It seems like it should work ok. In that case perhaps we can close this?

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

No branches or pull requests

3 participants