Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

fix: res.req only in Node.js, in browser use res.url instead #798

Merged
merged 1 commit into from
Jun 29, 2018

Conversation

alanshaw
Copy link
Contributor

No description provided.

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
@ghost ghost assigned alanshaw Jun 29, 2018
@ghost ghost added the in progress label Jun 29, 2018
if (isNode) {
log(res.req.method, `${res.req.getHeaders().host}${res.req.path}`, res.statusCode, res.statusMessage)
} else {
log(res.url, res.statusCode, res.statusMessage)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the method available or just the URL?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked but did not see the method

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's all POST anyway..

@alanshaw
Copy link
Contributor Author

Ok so tests are still failing but for other reasons, they got a whole lot further than they did last time (for the ones that actually got started).

@alanshaw alanshaw merged commit e8a5ab9 into master Jun 29, 2018
@ghost ghost removed the in progress label Jun 29, 2018
@alanshaw alanshaw deleted the fix/res-req branch June 29, 2018 12:02
@requilence
Copy link
Contributor

@alanshaw @achingbrain When I run last version of ipfs-api inside Electron, isNode is true, but res.req is undefined. So it may be better to check if (res.req) instead of using detect-node?

@alanshaw
Copy link
Contributor Author

alanshaw commented Jul 9, 2018

Thanks @requilence - I've created an issue to track this #807 - would you be willing to send a PR to fix this?

danieldaf pushed a commit to danieldaf/js-ipfs-api that referenced this pull request Jul 21, 2018
…active#798)

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants