arquillian-core icon indicating copy to clipboard operation
arquillian-core copied to clipboard

URLResourceProvider does not behave consistently for servlet and non-servlet containers

Open mkouba opened this issue 6 years ago • 1 comments

Issue Overview

An injected @ArquillianResource URL ends with a slash for servlet containers but does not end with a slash for non-servlet containers. See also org.jboss.arquillian.container.spi.client.protocol.metadata.Servlet.getBaseURIAsString() and org.jboss.arquillian.container.test.impl.enricher.resource.URLResourceProvider.toURL(HTTPContext) - only the host and port is used here and so no slash is added to the URL.

Expected Behaviour

The behavior should be identical for both use cases. It would probably make sense to always add a slash, e.g. url + "myResource" and not url + "/myResource. Also most Arquillian adapters are servlet-based.

mkouba avatar Oct 01 '19 14:10 mkouba

It is easy enough to add this behavior by adding a rootContext to the HttpContext, but the question is, should it default to "/" or null and keep the current behavior?

starksm64 avatar May 02 '23 23:05 starksm64