mirror of
https://github.com/KeygraphHQ/juice-shop.git
synced 2026-11-10 17:19:00 -10:00
27 lines
816 B
TypeScript
27 lines
816 B
TypeScript
/*
|
|
* Copyright (c) 2014-2025 Bjoern Kimminich & the OWASP Juice Shop contributors.
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
import * as frisby from 'frisby'
|
|
import config from 'config'
|
|
|
|
const API_URL = 'http://localhost:3000/api'
|
|
const REST_URL = 'http://localhost:3000/rest'
|
|
|
|
describe('/api', () => {
|
|
it('GET error when query /api without actual resource', () => {
|
|
return frisby.get(API_URL)
|
|
.expect('status', 500)
|
|
})
|
|
})
|
|
|
|
describe('/rest', () => {
|
|
it('GET error message with information leakage when calling unrecognized path with /rest in it', () => {
|
|
return frisby.get(REST_URL + '/unrecognized')
|
|
.expect('status', 500)
|
|
.expect('bodyContains', '<h1>' + config.get<string>('application.name') + ' (Express')
|
|
.expect('bodyContains', 'Unexpected path: /rest/unrecognized')
|
|
})
|
|
})
|