Manually escape '#' when building relative uris, fixes #42459

This commit is contained in:
Jan 2018-03-11 18:46:35 +01:00
parent afd2d38111
commit 2824a72552
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
title: Fix relative uri when "#" is in branch name
merge_request:
author: Jan
type: fixed

View File

@ -84,7 +84,7 @@ module Banzai
relative_url_root,
project.full_path,
uri_type(file_path),
Addressable::URI.escape(ref),
Addressable::URI.escape(ref).gsub('#', '%23'),
Addressable::URI.escape(file_path)
].compact.join('/').squeeze('/').chomp('/')