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

Return the right value for rawResponse in CDP #164

Closed
2 tasks done
molant opened this issue Apr 27, 2017 · 9 comments
Closed
2 tasks done

Return the right value for rawResponse in CDP #164

molant opened this issue Apr 27, 2017 · 9 comments

Comments

@molant
Copy link
Member

molant commented Apr 27, 2017

Right now rawContent returns a Buffer with the right size but no content, and rawResponse doesn't return anything.

  • rawContent
  • rawResponse
@alrra alrra changed the title Return the right values for rawContent and rawResponse in CDP Return the right values for rawContent and rawResponse in CDP Apr 27, 2017
@molant molant self-assigned this Apr 27, 2017
@molant
Copy link
Member Author

molant commented Apr 27, 2017

Can't find a way to get the byte for any of those :(
I've opened this issue in the hopes of getting someone to answer...
Moving this back to the backlog.

@molant
Copy link
Member Author

molant commented Jun 9, 2017

rawContent is done. I'm still clueless on how to obtain rawResponse. If we have to do another request from node then I think we should change that property to be asynchronous so we don't request it if not needed.

@molant
Copy link
Member Author

molant commented Jun 9, 2017

Updating the title to better reflect what is missing.

@molant molant changed the title Return the right values for rawContent and rawResponse in CDP Return the right value for rawResponse in CDP Jun 9, 2017
@molant
Copy link
Member Author

molant commented Jun 22, 2017

@paulirish, @ebidel, do you know if there is a way to get the real bytes of a response? I can get the decoded ones but nothing else :(
If not, we might have to rely on request and use the same headers than the original request.

@paulirish
Copy link

@molant replied on ChromeDevTools/devtools-protocol#12 -- It seems like doing a followup request from node is the only workaround for this right now.

@alrra
Copy link
Contributor

alrra commented Jun 29, 2017

@paulirish Thanks for looking into it!

@molant
Copy link
Member Author

molant commented Jul 3, 2017

If we have to use request to do the reply we need to take into account the headers and cookies used in originally.

@molant
Copy link
Member Author

molant commented Jul 3, 2017

Also, I think that we should change the type of rawResponse from Buffer to Promise<Buffer>. The reason is that not all the rule configurations require this value and we will be making extra requests that are not needed and thus wasting time and bandwidth. We could potentially do the same for rawBody, I've seen it takes sometimes a bit to get the data too.

@molant
Copy link
Member Author

molant commented Sep 16, 2017

After syncing with @alrra my current plan for this is to:

  • make rawResponse and rawBody methods that return a Promise<Buffer>. This way we are not making things when we don't need.
  • user requester to get the rawResponse in remote-debugging-connector. Looks like this is the only way to get the response. We will use the same headers as the original request

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

3 participants