[ https://issues.apache.org/jira/browse/FELIX-2691?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Misha Koshelev updated FELIX-2691: ---------------------------------- Attachment: FELIX-2691-HttpServiceImpl-isNameValid-comply-OSGI-R42.patch Here is relevant text from spec: 102.10.3.2 org.osgi.service.http public void registerResources( String alias, String name, HttpContext context ) throws NamespaceException alias name in the URI namespace at which the resources are registered name the base name of the resources that will be registered context the HttpContext object for the registered resources, or null if a default HttpContext is to be created and used. Registers resources into the URI namespace. The alias is the name in the URI namespace of the Http Service at which the registration will be mapped. An alias must begin with slash ('/') and must not end with slash ('/'), with the exception that an alias of the form "/" is used to denote the root alias. The name parameter must also not end with slash ('/') with the exception that a name of the form "/" is used to denote the root of the bundle. See the specification text for details on how HTTP requests are mapped to servlet and resource registra- tions. > Apache Felix HTTP service HttpServiceImpl.isNameValid does not match OSGi > R4.2 spec? > ------------------------------------------------------------------------------------ > > Key: FELIX-2691 > URL: https://issues.apache.org/jira/browse/FELIX-2691 > Project: Felix > Issue Type: Bug > Components: HTTP Service > Affects Versions: http-2.0.4 > Environment: Not relevant > Reporter: Misha Koshelev > Attachments: > FELIX-2691-HttpServiceImpl-isNameValid-comply-OSGI-R42.patch > > Original Estimate: 0.5h > Remaining Estimate: 0.5h > > Filing bug per: > http://www.mail-archive.com/dev@felix.apache.org/msg19853.html > The R4.2 enterprise spec from > http://www.osgi.org/Download/File?url=/download/r4v42/r4.enterprise.pdf > on page 48 clearly states: > The name parameter must also not end with slash ('/') with the > exception that a name of the form "/" is used to denote the root of > the bundle. > The relevant code, in trunk, is, from > http://svn.apache.org/repos/asf/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceImpl.java > public void registerResources(String alias, String name, HttpContext context) > throws NamespaceException > { > if (!isNameValid(name)) { > throw new IllegalArgumentException( "Malformed resource > name [" + name + "]"); > } > ... > and > private boolean isNameValid(String name) > { > if (name == null) { > return false; > } > if (name.endsWith( "/" )) { > return false; > } > return true; > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.