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

Milton does not use UrlAdapter in every Handler - problem eliminating context path #102

Open
jfrommann opened this issue Dec 8, 2017 · 3 comments
Assignees
Labels

Comments

@jfrommann
Copy link

We use Milton in a separate webapp in our project. Since we have several webapps deployed in one application server, every webapp has to use its own context path. To eliminate the context path from Milton requests i implemented your UrlAdapter interface. This works fine for Get or Delete request but not for MkCol or Move for example.

I patched milton-server-ce myself to get this to work but i would prefer to see this resolved in an official release. Here is what i did:

Changed MkColHandler to get ResourceHandlerHelper injected and changed MkColHandler.process() to:
String finalurl = HttpManager.decodeUrl(resourceHandlerHelper.getUrlAdapter().getUrl(request));

Extended UrlAdapter by:
String processUrl(String url);
and delegated to this method in UrlAdapterImpl.getUrl() by spliting the original method.

Changed MoveHandler.processExistingResource() to:
String destUrl = resourceHandlerHelper.getUrlAdapter().processUrl(dest.url);
Resource rDest = manager.getResourceFactory().getResource(dest.host, destUrl);

@bradmac
Copy link
Contributor

bradmac commented Dec 10, 2017

👍

Thanks, I'll update accordingly.

@bradmac bradmac self-assigned this Dec 10, 2017
@jfrommann
Copy link
Author

Hi Brad, it turned out that i forgot the PutHandler. The changes here are similar to the MkColHandler.

@bradmac
Copy link
Contributor

bradmac commented Dec 18, 2017

Great, thank you. I should get to that in the next couple of days.

@bradmac bradmac added the bug label Dec 18, 2017
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