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

Site Alias with Canonical setting seems to be replacing the domain name with canonical form also in querystring parameters #5046

Open
ahawes-clarity opened this issue Mar 10, 2022 · 12 comments

Comments

@ahawes-clarity
Copy link

I just had an issue where a URL was inexplicably being rewritten.

The URL took the form of:
http://host.com/page?email=user@host.com

The site had one site alias of "www.host.com" and it was set as primary and the "Site Alias Mapping Mode" was set to "Canonical".

However, when my custom module code would read the value of the email parameter from the querystring of the above request I would get an email value of "user@www.host.com".

var email = Request.QueryString["email"];

As I understand, the site alias settings would typically rewrite requests for "host.com" to "www.host.com".

I update the "Site Alias Mapping Mode" to redirect and the problem went away.

My guess was that the code responsible for handling "Canonical" site alias mapping is just doing a simple replace which was replacing the "host.com" not just in the base URL but also incorrectly in the querystring.

I tried to find the issue in the DNN source and I think I might have found at least one instance of the issue in Default.aspx.cs.

image

@stale
Copy link

stale bot commented Jul 31, 2022

We have detected this issue has not had any activity during the last 90 days. That could mean this issue is no longer relevant and/or nobody has found the necessary time to address the issue. We are trying to keep the list of open issues limited to those issues that are relevant to the majority and to close the ones that have become 'stale' (inactive). If no further activity is detected within the next 14 days, the issue will be closed automatically.
If new comments are are posted and/or a solution (pull request) is submitted for review that references this issue, the issue will not be closed. Closed issues can be reopened at any time in the future. Please remember those participating in this open source project are volunteers trying to help others and creating a better DNN Platform for all. Thank you for your continued involvement and contributions!

@stale stale bot added the stale label Jul 31, 2022
@ahawes-clarity
Copy link
Author

Just commenting to keep this bug active.

@stale stale bot removed the stale label Aug 1, 2022
@stale
Copy link

stale bot commented Nov 2, 2022

We have detected this issue has not had any activity during the last 90 days. That could mean this issue is no longer relevant and/or nobody has found the necessary time to address the issue. We are trying to keep the list of open issues limited to those issues that are relevant to the majority and to close the ones that have become 'stale' (inactive). If no further activity is detected within the next 14 days, the issue will be closed automatically.
If new comments are are posted and/or a solution (pull request) is submitted for review that references this issue, the issue will not be closed. Closed issues can be reopened at any time in the future. Please remember those participating in this open source project are volunteers trying to help others and creating a better DNN Platform for all. Thank you for your continued involvement and contributions!

@stale stale bot added the stale label Nov 2, 2022
@ahawes-clarity
Copy link
Author

Just commenting to keep this bug active.

@valadas
Copy link
Contributor

valadas commented Nov 2, 2022

@ahawes-clarity since you appear to have found the problem, submitting a pull request would be much more efficient than keeping commenting on this stale issue.

@stale stale bot removed the stale label Nov 2, 2022
@ahawes-clarity
Copy link
Author

@valadas, I understand your point however, I don't have the time and without knowledge of the whole platform I can't be sure my solution is correct.

@valadas
Copy link
Contributor

valadas commented Nov 2, 2022

I am assuming you found this by putting a breakpoint there and you are comfortable enough to see what is happening in there. My guess is that you could simply split the string on the querystring start character and make that replacement happen only on the first part of the URL. If you submit a PR with such change, reviewers will point out if anything is not right and we can get this moving.

@ahawes-clarity
Copy link
Author

Thanks for your feedback. I will see if I have time. I haven't contributed previously so we will see how it goes.

@ahawes-clarity
Copy link
Author

I just reviewed the process and requirements to contribute and I just don't have the time. Most of my work time needs to be charged to a client and I can't justify client time to fix a DNN bug.

I had assumed that taking the time to find and pin-point the problem would be sufficient to see that the bug was addressed.

In any case, that is all I can do at the moment.

@valadas
Copy link
Contributor

valadas commented Jan 18, 2023

You do understand that contributors to fix such bugs also do it free and take some time off their real paid work to provide a free platform...

@valadas valadas added this to the Future: Patch milestone Jan 18, 2023
@david-poindexter
Copy link
Contributor

@ahawes-clarity I would highly recommend you consider billing your client for the fix they need in the platform. This is what we do all the time. And we are transparent about it to them. :)

@david-poindexter
Copy link
Contributor

david-poindexter commented Jan 18, 2023

Oh, and if you don't have the time, this is a perfect use case for GitHub Sponsors. You could bill your client, use that to sponsor a community member that is willing to help, and then it is a win-win-win-win.

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

No branches or pull requests

3 participants