fix: allow paths to asar archives to contain the .asar extension in directories (#20342)
This commit is contained in:
parent
4ac4b34ae9
commit
bf978e09e4
19 changed files with 204 additions and 183 deletions
|
@ -195,7 +195,7 @@ describe('protocol module', () => {
|
|||
})
|
||||
|
||||
describe('protocol.registerFileProtocol', () => {
|
||||
const filePath = path.join(fixturesPath, 'asar', 'a.asar', 'file1')
|
||||
const filePath = path.join(fixturesPath, 'test.asar', 'a.asar', 'file1')
|
||||
const fileContent = fs.readFileSync(filePath)
|
||||
const normalPath = path.join(fixturesPath, 'pages', 'a.html')
|
||||
const normalContent = fs.readFileSync(normalPath)
|
||||
|
@ -248,7 +248,7 @@ describe('protocol module', () => {
|
|||
})
|
||||
|
||||
it('fails when sending unexist-file', async () => {
|
||||
const fakeFilePath = path.join(fixturesPath, 'asar', 'a.asar', 'not-exist')
|
||||
const fakeFilePath = path.join(fixturesPath, 'test.asar', 'a.asar', 'not-exist')
|
||||
await registerFileProtocol(protocolName, (request, callback) => callback(fakeFilePath))
|
||||
await expect(ajax(protocolName + '://fake-host')).to.be.eventually.rejectedWith(Error, '404')
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue