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

[ws server]: host-filtering with wildcard as port number doesn't work #780

Closed
niklasad1 opened this issue May 23, 2022 · 0 comments · Fixed by #781
Closed

[ws server]: host-filtering with wildcard as port number doesn't work #780

niklasad1 opened this issue May 23, 2022 · 0 comments · Fixed by #781

Comments

@niklasad1
Copy link
Member

niklasad1 commented May 23, 2022

Host-filtering with wildcard in the port field doesn't work.

	let server = WsServerBuilder::default()
		.set_allowed_hosts(["http://localhost:*", "http://127.0.0.1:*"])
		.unwrap()
		.build("127.0.0.1:0")
		.await
		.unwrap();

      	let client = WsClientBuilder::default().build(&server_url).await.unwrap();
	let client = Arc::new(client);

	let r = client.request::<String>("say_hello", None).await;
        
        // Fails with 403 because the entire address is compared such as as `http://localhost:31881 !=  http://localhost:*`
	assert!(r.is_ok());

I have checked the HTTP server and it actually supports wildcards.

Also see paritytech/substrate#11480 for further information

@niklasad1 niklasad1 changed the title [ws server]: host-filtering with * doesn't work [ws server]: host-filtering with wildcard as port number doesn't work May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant