mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-17 23:56:56 +00:00
Launcher, app/base, sentry, update service
This commit is contained in:
@ -18,23 +18,23 @@
|
||||
package pmapi
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
// rootURL is the API root URL.
|
||||
//
|
||||
// This can be changed using build flags: pmapi_local for "localhost/api", pmapi_dev or pmapi_prod.
|
||||
// Default is pmapi_prod.
|
||||
//
|
||||
// It must not contain the protocol! The protocol should be in rootScheme.
|
||||
var rootURL = "api.protonmail.ch" //nolint[gochecknoglobals]
|
||||
var rootScheme = "https" //nolint[gochecknoglobals]
|
||||
|
||||
// The HTTP transport to use by default.
|
||||
var defaultTransport = &http.Transport{ //nolint[gochecknoglobals]
|
||||
Proxy: http.ProxyFromEnvironment,
|
||||
// rootScheme is the scheme to use for connections to the root URL.
|
||||
var rootScheme = "https" //nolint[gochecknoglobals]
|
||||
|
||||
func GetAPIConfig(configName, appVersion string) *ClientConfig {
|
||||
return &ClientConfig{
|
||||
AppVersion: strings.Title(configName) + "_" + appVersion,
|
||||
ClientID: configName,
|
||||
Timeout: 25 * time.Minute, // Overall request timeout (~25MB / 25 mins => ~16kB/s, should be reasonable).
|
||||
FirstReadTimeout: 30 * time.Second, // 30s to match 30s response header timeout.
|
||||
MinBytesPerSecond: 1 << 10, // Enforce minimum download speed of 1kB/s.
|
||||
}
|
||||
}
|
||||
|
||||
// checkTLSCerts controls whether TLS certs are checked against known fingerprints.
|
||||
// The default is for this to always be done.
|
||||
var checkTLSCerts = true //nolint[gochecknoglobals]
|
||||
|
||||
Reference in New Issue
Block a user