mirror of
https://git.sr.ht/~adnano/go-gemini
synced 2024-11-23 00:11:57 +01:00
Remove StatusSensitiveInput
This commit is contained in:
parent
8c453c7531
commit
7101402517
@ -84,7 +84,7 @@ func trustCertificate(hostname string, cert *x509.Certificate) error {
|
||||
}
|
||||
}
|
||||
|
||||
func getInput(prompt string, sensitive bool) (input string, ok bool) {
|
||||
func getInput(prompt string) (input string, ok bool) {
|
||||
fmt.Printf("%s ", prompt)
|
||||
scanner.Scan()
|
||||
return scanner.Text(), true
|
||||
@ -102,7 +102,7 @@ func do(req *gemini.Request, via []*gemini.Request) (*gemini.Response, error) {
|
||||
|
||||
switch resp.Status.Class() {
|
||||
case gemini.StatusInput:
|
||||
input, ok := getInput(resp.Meta, resp.Status == gemini.StatusSensitiveInput)
|
||||
input, ok := getInput(resp.Meta)
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
|
@ -6,7 +6,6 @@ type Status int
|
||||
// Gemini status codes.
|
||||
const (
|
||||
StatusInput Status = 10
|
||||
StatusSensitiveInput Status = 11
|
||||
StatusSuccess Status = 20
|
||||
StatusRedirect Status = 30
|
||||
StatusPermanentRedirect Status = 31
|
||||
@ -37,8 +36,6 @@ func (s Status) String() string {
|
||||
switch s {
|
||||
case StatusInput:
|
||||
return "Input"
|
||||
case StatusSensitiveInput:
|
||||
return "Sensitive input"
|
||||
case StatusSuccess:
|
||||
return "Success"
|
||||
case StatusRedirect:
|
||||
|
Loading…
Reference in New Issue
Block a user