Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

jsipfs fails with error when adding directory with trailing slash #954

Closed
rklaehn opened this issue Aug 21, 2017 · 2 comments
Closed

jsipfs fails with error when adding directory with trailing slash #954

rklaehn opened this issue Aug 21, 2017 · 2 comments
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up

Comments

@rklaehn
Copy link

rklaehn commented Aug 21, 2017

  • Version:

js-ipfs version: 0.25.1

  • Platform:

OSX 10.12.6

  • Subsystem:

Type:

Bug

Severity:

Medium

Description:

jsipfs add -r crashes when adding a directory ending with /

jsipfs add -r src/
/Users/rklaehn/.config/yarn/global/node_modules/ipfs/src/cli/commands/files/add.js:69
        throw err
        ^

Error: [object Object]
    at parseError (/Users/rklaehn/.config/yarn/global/node_modules/ipfs-api/src/utils/request-api.js:17:17)
    at ClientRequest.<anonymous> (/Users/rklaehn/.config/yarn/global/node_modules/ipfs-api/src/utils/request-api.js:39:14)
    at Object.onceWrapper (events.js:316:30)
    at emitOne (events.js:115:13)
    at ClientRequest.emit (events.js:210:7)
    at HTTPParser.parserOnIncomingClient (_http_client.js:564:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:116:23)
    at Socket.socketOnData (_http_client.js:453:20)
    at emitOne (events.js:115:13)
    at Socket.emit (events.js:210:7)

Steps to reproduce the error:

Add a directory ending with /, e.g. src/

Expected behaviour

Fail with a meaningful error message.

@daviddias daviddias added kind/bug A bug in existing code (including security flaws) exp/novice Someone with a little familiarity can pick up P2 Medium: Good to have, but can wait until someone steps up labels Aug 22, 2017
@daviddias
Copy link
Member

Thanks for reporting this bug @rklaehn :)

Would you like to take a stap at fixing the issue? The solution needs to be applied here:
https://github.com/ipfs/js-ipfs/blob/master/src/cli/commands/files/add.js

The solution should be to actually add the directory despite of the meaningless / added in the end.

@daviddias daviddias added the help wanted Seeking public contribution on this issue label Sep 1, 2017
@daviddias
Copy link
Member

daviddias commented Sep 4, 2017

Just got solved in #985 (review) by @dbachko (Thank you! :D)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up
Projects
None yet
Development

No branches or pull requests

2 participants