mirror of
https://github.com/makew0rld/amfora.git
synced 2024-12-04 14:46:29 -05:00
🐛 Don't rerequest resource when bypassing TOFU
This commit is contained in:
parent
bd6daa5a3c
commit
e8e23c7fe6
@ -105,11 +105,9 @@ func handleTofu(cert *x509.Certificate, port string) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoveTofuEntry invalidates the TOFU entry in the database for the given cert and port.
|
// ResetTofuEntry forces the cert passed to be valid, overwriting any previous TOFU entry.
|
||||||
// This will make any cert for that domain valid.
|
|
||||||
//
|
|
||||||
// The port string can be empty, to indicate port 1965.
|
// The port string can be empty, to indicate port 1965.
|
||||||
func RemoveTofuEntry(cert *x509.Certificate, port string) {
|
func ResetTofuEntry(cert *x509.Certificate, port string) {
|
||||||
tofuStore.Set(idKey(cert.Subject.CommonName, port), "")
|
tofuStore.Set(idKey(cert.Subject.CommonName, port), "")
|
||||||
tofuStore.WriteConfig()
|
tofuStore.WriteConfig()
|
||||||
}
|
}
|
||||||
|
@ -228,13 +228,14 @@ func handleURL(u string) (string, bool) {
|
|||||||
if err == client.ErrTofu {
|
if err == client.ErrTofu {
|
||||||
if Tofu(parsed.Host) {
|
if Tofu(parsed.Host) {
|
||||||
// They want to continue anyway
|
// They want to continue anyway
|
||||||
client.RemoveTofuEntry(res.Cert, parsed.Port())
|
client.ResetTofuEntry(res.Cert, parsed.Port())
|
||||||
return handleURL(u)
|
// Response can be used further down
|
||||||
|
} else {
|
||||||
|
// They don't want to continue
|
||||||
|
// Set the bar back to original URL
|
||||||
|
bottomBar.SetText(tabMap[curTab].Url)
|
||||||
|
return "", false
|
||||||
}
|
}
|
||||||
// They don't want to continue
|
|
||||||
// Set the bar back to original URL
|
|
||||||
bottomBar.SetText(tabMap[curTab].Url)
|
|
||||||
return "", false
|
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
Error("URL Fetch Error", err.Error())
|
Error("URL Fetch Error", err.Error())
|
||||||
// Set the bar back to original URL
|
// Set the bar back to original URL
|
||||||
|
Loading…
Reference in New Issue
Block a user