Nest: Path param put in middle of a url does not work - returns 403 Not Found

Created on 2 Oct 2020  路  5Comments  路  Source: nestjs/nest

Currently when I want to access an endpoints:
_api/someEndpoint/:pathParam/endOfEndpoint_ returns 403. But if I put it like that:
__api/someEndpoint/endOfEndpoint/:pathParam__ it works.

Shouldn't we be able to use the first case as well?

needs triage type

Most helpful comment

Out of respect for maintainers of open source software, it is customary to provide a minimum reproduction, so that we do not need to spend time getting _your_ setup just right. So I'll ask again: Can you provide a minimum reproduction repository?

All 5 comments

Hi @Edwardchorius Please give code example in order to have a clear idea about the problem
thanks

This works:
`@Controller('api/vehicles')
export class SettingsController
...

@Patch('/repair/:partType')`
, whereas this does NOT work:

`@Controller('api/vehicles/:partType')
export class SettingsController
...

@Patch('repair')`

Can you provide a minimum reproduction repository?

This is all there is. You have a standard controller class and action methods, decorated with 'Patch', 'Get'. You have a part of the url stated in the class and other parts in the action methods. When I put the path param somewhere but not at the end of the url , when testing with Postman, I receive a 403 Not Found error.

Out of respect for maintainers of open source software, it is customary to provide a minimum reproduction, so that we do not need to spend time getting _your_ setup just right. So I'll ask again: Can you provide a minimum reproduction repository?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KamGor picture KamGor  路  3Comments

cdiaz picture cdiaz  路  3Comments

JulianBiermann picture JulianBiermann  路  3Comments

cojack picture cojack  路  3Comments

janckerchen picture janckerchen  路  3Comments