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

Sanitize URL pattern from rootPath #785

Merged
merged 1 commit into from Apr 16, 2015

Conversation

Projects
None yet
7 participants
@Toilal
Contributor

Toilal commented Nov 20, 2014

This is related to #784

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Nov 20, 2014

Coverage Status

Coverage remained the same when pulling 6833104 on Toilal:rootPath into be79100 on dropwizard:master.

coveralls commented Nov 20, 2014

Coverage Status

Coverage remained the same when pulling 6833104 on Toilal:rootPath into be79100 on dropwizard:master.

@Toilal

This comment has been minimized.

Show comment
Hide comment
@Toilal

Toilal Nov 30, 2014

Contributor

@joschi

* is removed from rootPath parameter for DropWizard endpoints.

But DropwizardResourceConfig#getUrlPattern() is called by AbstractServerFactory#createAppServlet(). This Url pattern is the unmodified one, loaded by rootPath parameter.

So the default path in docs /, and any other path without any ending /* will pass validation, but servlet won't be registered properly in Jersey.

I'll update my pull request to fix this issue instead of modifying the docs to make it work.

Contributor

Toilal commented Nov 30, 2014

@joschi

* is removed from rootPath parameter for DropWizard endpoints.

But DropwizardResourceConfig#getUrlPattern() is called by AbstractServerFactory#createAppServlet(). This Url pattern is the unmodified one, loaded by rootPath parameter.

So the default path in docs /, and any other path without any ending /* will pass validation, but servlet won't be registered properly in Jersey.

I'll update my pull request to fix this issue instead of modifying the docs to make it work.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Nov 30, 2014

Coverage Status

Coverage increased (+0.02%) when pulling 67fe6b5 on Toilal:rootPath into 07fe33c on dropwizard:master.

coveralls commented Nov 30, 2014

Coverage Status

Coverage increased (+0.02%) when pulling 67fe6b5 on Toilal:rootPath into 07fe33c on dropwizard:master.

@Toilal Toilal changed the title from Documentation enhancements to Sanitize URL pattern from rootPath Nov 30, 2014

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Jan 12, 2015

Coverage Status

Coverage increased (+0.01%) when pulling 3fbfd15 on Toilal:rootPath into 8a1d9ca on dropwizard:master.

coveralls commented Jan 12, 2015

Coverage Status

Coverage increased (+0.01%) when pulling 3fbfd15 on Toilal:rootPath into 8a1d9ca on dropwizard:master.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Jan 12, 2015

Coverage Status

Coverage increased (+0.01%) when pulling 3fbfd15 on Toilal:rootPath into 8a1d9ca on dropwizard:master.

coveralls commented Jan 12, 2015

Coverage Status

Coverage increased (+0.01%) when pulling 3fbfd15 on Toilal:rootPath into 8a1d9ca on dropwizard:master.

@Toilal

This comment has been minimized.

Show comment
Hide comment
@Toilal

Toilal Jan 22, 2015

Contributor

Is it plan to merge this one ?

Contributor

Toilal commented Jan 22, 2015

Is it plan to merge this one ?

@jplock

This comment has been minimized.

Show comment
Hide comment
@jplock

jplock Mar 9, 2015

Member

Is this still an issue now that DW 0.8 has been released?

Member

jplock commented Mar 9, 2015

Is this still an issue now that DW 0.8 has been released?

@Toilal

This comment has been minimized.

Show comment
Hide comment
@Toilal

Toilal Mar 9, 2015

Contributor

I just gave a try on my webapp with DW 0.8, and issue is still there.

My configuration is

server:
  type: simple
  rootPath: /api/*
  applicationContextPath: /
  adminContextPath: /admin
  connector:
    type: http
    port: 35180

When setting rootPath: /api/, resources are not loaded. (Adding * is the current workaround).

Contributor

Toilal commented Mar 9, 2015

I just gave a try on my webapp with DW 0.8, and issue is still there.

My configuration is

server:
  type: simple
  rootPath: /api/*
  applicationContextPath: /
  adminContextPath: /admin
  connector:
    type: http
    port: 35180

When setting rootPath: /api/, resources are not loaded. (Adding * is the current workaround).

@jplock

This comment has been minimized.

Show comment
Hide comment
@jplock

jplock Mar 14, 2015

Member

@joschi do you have any thoughts on merging this one in?

Member

jplock commented Mar 14, 2015

@joschi do you have any thoughts on merging this one in?

@carlo-rtr

This comment has been minimized.

Show comment
Hide comment
@carlo-rtr

carlo-rtr Apr 15, 2015

Member

I took a look, and it seems the trailing * is required when providing a the path spec to Handler.addServlet, similar to this guide here: https://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty

Member

carlo-rtr commented Apr 15, 2015

I took a look, and it seems the trailing * is required when providing a the path spec to Handler.addServlet, similar to this guide here: https://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty

@carlo-rtr carlo-rtr self-assigned this Apr 15, 2015

@carlo-rtr

This comment has been minimized.

Show comment
Hide comment
@carlo-rtr

carlo-rtr Apr 16, 2015

Member

Thank you.

Member

carlo-rtr commented Apr 16, 2015

Thank you.

carlo-rtr added a commit that referenced this pull request Apr 16, 2015

Merge pull request #785 from Toilal/rootPath
Sanitize URL pattern from rootPath

@carlo-rtr carlo-rtr merged commit f42f8c6 into dropwizard:master Apr 16, 2015

@jplock jplock added this to the 0.9.0 milestone Apr 16, 2015

@arteam arteam added the bug label Apr 26, 2015

@Toilal Toilal deleted the Toilal:rootPath branch May 21, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment