Skip to content

Commit 4e16358

Browse files
committed
Allow hyphens in GITHUB_URL
The parsing of the `GITHUB_URL` should support hyphens in host names to comply with https://tools.ietf.org/html/rfc952 . Otherwise `gist` will fail to find the corresponding `.gist` token file if the server contains a hyphen. For example, `https://github.my-corp.com/`. Signed-off-by: Lucas Magasweran <[email protected]>
1 parent ab14e27 commit 4e16358

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/gist.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ClipboardError < RuntimeError; include Error end
4444
module AuthTokenFile
4545
def self.filename
4646
if ENV.key?(URL_ENV_NAME)
47-
File.expand_path "~/.gist.#{ENV[URL_ENV_NAME].gsub(/:/, '.').gsub(/[^a-z0-9.]/, '')}"
47+
File.expand_path "~/.gist.#{ENV[URL_ENV_NAME].gsub(/:/, '.').gsub(/[^a-z0-9.-]/, '')}"
4848
else
4949
File.expand_path "~/.gist"
5050
end

0 commit comments

Comments
 (0)