-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
kind/bugA bug in existing code (including security flaws)A bug in existing code (including security flaws)topic/apiTopic apiTopic api
Description
Version/Platform/Processor information (from ipfs version --all
):
go-ipfs version: 0.4.2-255c6f3
Repo version: 3
System version: amd64/darwin
Golang version: go1.6
Type: bug
Area: api, commands
Priority (from P0: functioning, to P4: operations on fire): P2
Description:
After executing a ipfs config replace
, ipfs replaces the config but not to one that was defined and if a ipfs config show
is executed after, the Content-Type
of the response is text/plain
instead of the expected application/json
. This breaks js-ipfs-api config.replace feature.
This was detected on: https://github.com/ipfs/js-ipfs-api/pull/307/files#r69281789
How to reproduce using just the ipfs CLI
> ipfs config replace <some random json file, I used a package.json>
> cat ~/.ipfs/config
{
"API": {
"HTTPHeaders": null
},
"Addresses": {
"API": "",
"Gateway": "",
"Swarm": null
},
"Bootstrap": null,
"Datastore": {
"GCPeriod": "",
"NoSync": false,
"Params": null,
"Path": "",
"StorageGCWatermark": 0,
"StorageMax": "",
"Type": ""
},
"Discovery": {
"MDNS": {
"Enabled": false,
"Interval": 0
}
},
"Gateway": {
"HTTPHeaders": null,
"PathPrefixes": null,
"RootRedirect": "",
"Writable": false
},
"Identity": {
"PeerID": "",
"PrivKey": ""
},
"Ipns": {
"RecordLifetime": "",
"RepublishPeriod": "",
"ResolveCacheSize": 0
},
"Mounts": {
"FuseAllowOther": false,
"IPFS": "",
"IPNS": ""
},
"SupernodeRouting": {
"Servers": null
},
"Swarm": {
"AddrFilters": null
},
"Tour": {
"Last": ""
}
}
# Now you can open a tool like Wireshark to check the headers of the following response
> ipfs config show
# ... prints the config again, but the Content-Type was text/plain
Metadata
Metadata
Assignees
Labels
kind/bugA bug in existing code (including security flaws)A bug in existing code (including security flaws)topic/apiTopic apiTopic api