Closed smalllong closed 2 years ago
Hi @smalllong please provide a code example of how are you passing an empty baseUrl
var createRequest = require('node-mocks-http').createRequest;
console.log(createRequest({
baseUrl: '',
path: '/category/request',
method: 'POST',
}))
Could you try the following:
const req = createRequest({
path: '/category/request',
method: 'POST',
});
req._setBaseUrl('');
// or
re.baseUrl = '';
That may be working, although I don't think that's the correct solution
Stale issue message
In real apps, baseUrl can be empty and path be non-empty when not using router middlewares. But in this mocks, baseUrl is always non-empty when path is not empty. I can not pass an empty baseUrl to override it as it always fallback to path. Why is that?