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

RewritePatternRule does not support matrix parameters #430

Closed
celandro opened this issue Mar 15, 2016 · 4 comments
Closed

RewritePatternRule does not support matrix parameters #430

celandro opened this issue Mar 15, 2016 · 4 comments
Labels
Stale For auto-closed stale issues and pull requests

Comments

@celandro
Copy link

We ran into this and spent some time debugging it. It seems the correct place to fix it is in the applyURI rule where the query params are added back in. I am sure the other rewrite rules also have the same issue.

For now we are working around the issue with the following class which does have matrix params properly loaded in jax-rs2. I do not know if this code handles every possible matrix param case, but it handles the ones we need. To use just make a jar with this class file and put it in the lib/ext directory.

public class MatrixParamRewritePatternRule extends RewritePatternRule {
    public MatrixParamRewritePatternRule() {
        super();
    }
    @Override
    public void applyURI(Request request, String oldURI, String newURI) throws IOException
    {
        // hack in the matrix params
        int matrixParamIndex = oldURI.indexOf(';');
        if (matrixParamIndex > 0) {
            newURI = newURI + oldURI.substring(matrixParamIndex);
        }
        super.applyURI(request, oldURI, newURI);
    }

}
@joakime
Copy link
Contributor

joakime commented Mar 15, 2016

Are you talking about URI path parameters?

@celandro
Copy link
Author

Yes, in Jax-rs its @MatrixParam

Example uri:
wget "http://localhost:7910/singles/qaas-v1/questionnaire/user/62116719/info;type=1;type=4?_=1457574072265"

@stale
Copy link

stale bot commented Nov 20, 2019

This issue has been automatically marked as stale because it has been a full year without activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale For auto-closed stale issues and pull requests label Nov 20, 2019
@joakime
Copy link
Contributor

joakime commented Nov 20, 2019

Addressed in PR #4337 (Issue #4329)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale For auto-closed stale issues and pull requests
Projects
None yet
Development

No branches or pull requests

2 participants