Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic routes not removed #1825

Closed
mks opened this issue Dec 16, 2024 · 1 comment
Closed

Dynamic routes not removed #1825

mks opened this issue Dec 16, 2024 · 1 comment
Labels

Comments

@mks
Copy link

mks commented Dec 16, 2024

Reproduction:

const app = uWS.App({})

app.get( "/*", ( res, req ) => { res.writeStatus( "404 Not Found" ); res.end() })

app.get( "/route", ( res, req ) => { res.writeStatus( "200 OK" ); res.end() })
app.get( "/route/:id", ( res, req ) => { res.writeStatus( "200 Zombie" ); res.end() })

app.get( "/route", null ) // Correctly removed.
app.get( "/route/:id", null ) // NOT removed.

app.listen( 8888, async ( listenSocket ) =>
{
	if ( listenSocket )
	{
		let method = "GET"
		let cases = [
			`http://localhost:8888/route`,
			`http://localhost:8888/route/23`
		]
		for ( const url of cases )
		{
			const { status, statusText } = await fetch( url )
			console.log( `GET ${url} -> ${status} ${statusText}` )
		}

		process.exit()
	}
})

Tested on macOS using latest uWS (v20.51.0). With v20.49.0 was also not working.

@uNetworkingAB uNetworkingAB transferred this issue from uNetworking/uWebSockets.js Dec 16, 2024
@uNetworkingAB
Copy link
Contributor

I will add this case to the tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants