routing-controllers icon indicating copy to clipboard operation
routing-controllers copied to clipboard

fix: empty page on @Render() responds with 404

Open jaimeadf opened this issue 1 year ago • 0 comments

Description

When the page specified in the @Render() decorator returns an empty string, the server responds with the status code 404 (Not Found).

Minimal code-snippet showcasing the problem

import { Controller, Get, Render } from 'routing-controllers';

@Controller()
export class MyController {
    @Get()
	@Render('index.pug') // index.pug must be empty
	index() {
		
	}
}

Expected behavior

The server should send an empty body and respond with 200 (OK).

Actual behavior

The server sends the error page and responds with 404 (Not Found).

jaimeadf avatar Jul 18 '22 23:07 jaimeadf