Skip to content

Commit

Permalink
Merge pull request #911 from PlanoramaEvents/fix-survey-url
Browse files Browse the repository at this point in the history
Fix double slash in URL for mailings
  • Loading branch information
balen authored Dec 28, 2023
2 parents d68e3cc + 3a63fd5 commit 97656eb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/services/url_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ def self.url_for(path:)
host = ENV["HOSTNAME"]
port = ENV["HOSTPORT"]

# Remove any slash from the start of the path if there happens to be one
# as we add one when building the URL with the protocol and host
if path.start_with?("/")
path = path[1..-1]
end

if port
"#{protocol}://#{host}:#{port}/#{path}"
else
Expand Down

0 comments on commit 97656eb

Please sign in to comment.