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

feat: metadata for ipfs.get #2759

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"ipfs-bitswap": "^0.27.0",
"ipfs-block": "~0.8.1",
"ipfs-block-service": "~0.16.0",
"ipfs-http-client": "^42.0.0",
"ipfs-http-client": "github:ipfs/js-ipfs-http-client#feat/meta-for-get",
"ipfs-http-response": "^0.5.0",
"ipfs-mfs": "^1.0.0",
"ipfs-multipart": "^0.3.0",
Expand Down Expand Up @@ -184,7 +184,7 @@
"form-data": "^3.0.0",
"go-ipfs-dep": "^0.4.23",
"hat": "0.0.3",
"interface-ipfs-core": "^0.131.7",
"interface-ipfs-core": "github:ipfs/interface-js-ipfs-core#test/meta-for-get",
"ipfs-interop": "github:ipfs/interop#refactor/async-await",
"ipfsd-ctl": "github:ipfs/js-ipfsd-ctl#remove-option-normalisation",
"ncp": "^2.0.0",
Expand Down
4 changes: 3 additions & 1 deletion src/http/api/resources/files-regular.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ exports.get = {
async function * (source) {
for await (const file of source) {
const header = {
name: file.path
name: file.path,
mtime: file.mtime ? new Date(file.mtime.secs * 1000) : null,
Copy link
Member

Choose a reason for hiding this comment

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

Similar to my comment on ipfs-inactive/js-ipfs-http-client#1235 - can this support the nsecs mtime component too?

Copy link
Member

Choose a reason for hiding this comment

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

I think this might be more complicated than I'd previously thought - it-tar emits regular tar files, right? As I understand it, regular tar files only support seconds for mtimes, higher resolution requires GNU Tar files so it-tar may need to be updated to support producing these.

Copy link
Member Author

Choose a reason for hiding this comment

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

mode: file.mode
}

if (file.content) {
Expand Down