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

redirect from path should allow smarter replacements #5

Closed
jtmoon79 opened this issue Dec 4, 2019 · 1 comment
Closed

redirect from path should allow smarter replacements #5

jtmoon79 opened this issue Dec 4, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@jtmoon79
Copy link
Owner

jtmoon79 commented Dec 4, 2019

problem

Given a path like https://service.corp.com/a/1234 I would like a shortcut path http://goto/a/1234 to redirect to https://service.corp.com/a/1234.
Currently, it cannot.

The user requested path /a/1234 does not match the Administrator-set redirect entry /a.

Allowing the user to declare redirects where the from path could be a bit smarter would be ideal.

idea 1

Allow strings-style Template Syntax in the from redirect path. Matching the request path would vary from current strictly string compare of requested from_path == redirect from_path to something smarter.

For example, redirects file entry like:

/a${path} https://service.corp.com/a${path} user

Request http://goto/a/1234 would redirect to https://service.corp.com/a/1234.
Request http://goto/a would redirect to https://service.corp.com/a.
In effect, all requested paths /a* would match.

Something difficult about this is allowing multiple similar redirect paths. For example, imagine redirects entrys

/a${path} https://service.corp.com/a${path} user
/alpha https://build-server.corp.com/builds/release-alpha/ user

All requests to http://goto/alpha would match to entry /a${path} (user would end up at unwanted location https://service.corp.com/alpha). The matching algorithm should allow matching these as the Administrator would expect:
/alpha -> https://build-server.corp.com/builds/release-alpha/
a/123 -> https://service.corp.com/a/123
Otherwise, a redirect entry like /a${path} "smothers" any further redirect entries that start with substring /a.

@jtmoon79 jtmoon79 added the enhancement New feature or request label Dec 4, 2019
@jtmoon79 jtmoon79 added this to the Priority 1 (More Important) milestone Dec 5, 2019
jtmoon79 added a commit that referenced this issue Jan 1, 2020
Add feature Required Request Modifiers that accepts
'/;?' in Redirect Entry 'From' field.

Update pytests to reflect these.

Update README.md with latest --help.

Other various tweaks.

Issue #5
@jtmoon79
Copy link
Owner Author

jtmoon79 commented Jan 1, 2020

Implemented via Required Request Modifiers and Template Syntax replacements.

@jtmoon79 jtmoon79 closed this as completed Jan 1, 2020
@jtmoon79 jtmoon79 self-assigned this Jan 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant