Closed josephmturner closed 1 year ago
Unlike the solution in v8.6.1:
const canonical = `hyper://${archive.key.toString('hex')}${path || ''}` responseHeaders.Link = `<${canonical}>; rel="canonical"
it is not necessary to use pathname || '', since pathname will always contain at least '/'. In that case, Array.substring correctly leaves behind the empty string.
pathname || ''
Resolves #42
For future reference, string.substr is deprecated and should not be used. I've just pushed the fixes using a slightly different pattern in 9.0.3
string.substr
Thank you - your solution is much nicer than mine.
Unlike the solution in v8.6.1:
it is not necessary to use
pathname || ''
, since pathname will always contain at least '/'. In that case, Array.substring correctly leaves behind the empty string.Resolves #42