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

make possible to rewrite destination urls by domain mappings #500

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

ziollek
Copy link
Contributor

@ziollek ziollek commented Oct 10, 2023

Rationale:
The current approach assumes that if the mapping exists for the destination URL domain then such domain should be replaced by source domain mapping. Such an assumption has no justification. The new approach is based on simple logic:

  • if source and destination domains share the same mappings then the destination URL is replaced by matched source domain
  • in another case if there exists exactly one mapping for the destination domain such mapping is used
  • if any of the above conditions are met by the default destination domain it is used without any altering

What has been done

  • changing init for VclRedirect object (we additionally pass there destination URL)
  • adding helper methods that provide all mapping for the parsed destination domain
  • implementing logic according to the rules described above

@awmackowiak awmackowiak merged commit 6534c7a into master Oct 11, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants