Disable changing TLS if STS is enforced

This commit is contained in:
Pavel Djundik 2020-02-19 13:26:43 +02:00
parent d9985e7318
commit 568427ca98
2 changed files with 14 additions and 2 deletions

View file

@ -65,10 +65,18 @@
type="checkbox"
name="tls"
:checked="defaults.tls ? true : false"
:disabled="config.lockNetwork ? true : false"
:disabled="
config.lockNetwork || defaults.hasSTSPolicy ? true : false
"
@change="onSecureChanged"
/>
Use secure connection (TLS)
<span
v-if="defaults.hasSTSPolicy"
class="tooltipped tooltipped-n tooltipped-no-delay"
aria-label="This network has a strict transport security policy, you will be unable to disable TLS"
>🔒 STS</span
>
</label>
<label class="tls">
<input

View file

@ -396,7 +396,11 @@ Network.prototype.exportForEdit = function() {
fieldsToReturn = ["name", "nick", "username", "password", "realname"];
}
return _.pick(this, fieldsToReturn);
const data = _.pick(this, fieldsToReturn);
data.hasSTSPolicy = !!STSPolicies.get(this.host);
return data;
};
Network.prototype.export = function() {