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

Have request.url take relative_url_root into account #24396

Closed
wants to merge 1 commit into from

Conversation

maclover7
Copy link
Contributor

ref #24393

private

def relative_url_root
get_header('action_controller.instance'.freeze).relative_url_root || ''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

''.freeze

@pixeltrix
Copy link
Contributor

I have a terrible feeling that doing this will break loads of applications

@guilleiguaran
Copy link
Member

I believed that we deprecated RAILS_RELATIVE_URL_ROOT in favor of Rack's SCRIPT_NAME years ago but now I see that we never did it.

@pixeltrix
Copy link
Contributor

@guilleiguaran unfortunately SCRIPT_NAME doesn't exist outside of a request so wouldn't work for mailers, background jobs, etc. This is why we un-deprecated RAILS_RELATIVE_URL_ROOT.

@rails-bot
Copy link

rails-bot bot commented Dec 18, 2019

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@rails-bot rails-bot bot added the stale label Dec 18, 2019
@rails-bot rails-bot bot closed this Dec 25, 2019
@kikonen
Copy link

kikonen commented May 8, 2021

too bad that this was closed

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.

None yet

5 participants