Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
/coder-v1-cliPublic archive

login: detect missing protocol in URL#54

Merged
Russtopia merged 1 commit intomasterfrom53-detect-missing-protocol
Jun 19, 2020
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletionscmd/coder/login.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,7 @@ import (
"net"
"net/http"
"net/url"
"strings"
"sync"

"github.com/pkg/browser"
Expand All@@ -22,13 +23,13 @@ type loginCmd struct {
func (cmd loginCmd) Spec() cli.CommandSpec {
return cli.CommandSpec{
Name: "login",
Usage: "[Coder Enterprise URL]",
Usage: "[Coder Enterprise URL eg. http://my.coder.domain/]",
Desc: "authenticate this client for future operations",
}
}
func (cmd loginCmd) Run(fl *pflag.FlagSet) {
rawURL := fl.Arg(0)
if rawURL == "" {
if rawURL == ""|| !strings.HasPrefix(rawURL, "http"){
exitUsage(fl)
Copy link
Author

Choose a reason for hiding this comment

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

I tested againsthttp://localhost:8080,http://master.cdr.dev/ andhttps://master.cdr.dev/ and all seem to work (ie., master.cdr.dev auto-downgrades the login URL to http, which I assume is desired).

}

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp