-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: add HTTP Gateway support for /ipns/ paths #2020
Changes from 1 commit
97d03fc
31233e0
99d92b7
bb67cc2
eebde0b
c21709d
7e3e7b2
f1da001
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,19 +2,37 @@ | |
|
||
const resources = require('../resources') | ||
|
||
module.exports = { | ||
method: '*', | ||
path: '/ipfs/{cid*}', | ||
options: { | ||
handler: resources.gateway.handler, | ||
pre: [ | ||
{ method: resources.gateway.checkCID, assign: 'args' } | ||
], | ||
response: { | ||
ranges: false // disable built-in support, we do it manually | ||
}, | ||
ext: { | ||
onPostHandler: { method: resources.gateway.afterHandler } | ||
module.exports = [ | ||
{ | ||
method: '*', | ||
path: '/ipfs/{immutableId*}', | ||
lidel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
options: { | ||
handler: resources.gateway.handler, | ||
pre: [ | ||
{ method: resources.gateway.checkImmutableId, assign: 'args' } | ||
], | ||
response: { | ||
ranges: false // disable built-in support, we do it manually | ||
}, | ||
ext: { | ||
onPostHandler: { method: resources.gateway.afterHandler } | ||
} | ||
} | ||
}, | ||
{ | ||
method: '*', | ||
path: '/ipns/{mutableId*}', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should define what we should call this id, libp2p-key, ipns-key-id, even ipns-cid (content been the hash of the pubkey) and we should PR to the spec https://github.com/ipfs/specs/tree/master/naming this new name. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have libp2p-key multicodec now for presenting IPNS names as base32 CIDv1, but it can also be FQDN with DNSLink, so I renamed it to I did not touch mentioned spec as |
||
options: { | ||
handler: resources.gateway.handler, | ||
pre: [ | ||
{ method: resources.gateway.checkMutableId, assign: 'args' } | ||
], | ||
response: { | ||
ranges: false // disable built-in support, we do it manually | ||
}, | ||
ext: { | ||
onPostHandler: { method: resources.gateway.afterHandler } | ||
} | ||
} | ||
} | ||
} | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
'use strict' | ||
|
||
module.exports = [require('./gateway')] | ||
module.exports = [...require('./gateway')] | ||
lidel marked this conversation as resolved.
Show resolved
Hide resolved
|
Uh oh!
There was an error while loading. Please reload this page.