Fix illegal base64 errors

master
HimbeerserverDE 2022-04-21 14:46:13 +02:00
parent 61b3f3f659
commit c518617f8d
No known key found for this signature in database
GPG Key ID: A3D3E205DA0B0401
2 changed files with 6 additions and 2 deletions

View File

@ -73,7 +73,7 @@ type Config struct {
// Conf returns a copy of the Config used by the proxy.
// Any modifications will not affect the original Config.
func Conf() Config {
loadConfigOnce.Do(func (){
loadConfigOnce.Do(func() {
if err := LoadConfig(); err != nil {
log.Fatal(err)
}

View File

@ -232,7 +232,11 @@ func handleContent(cc *contentConn) {
var filenames []string
RequestLoop:
for _, f := range cmd.Files {
for i, f := range cmd.Files {
if len(f.Base64SHA1)%2 != 0 {
cmd.Files[i].Base64SHA1 += "="
}
if cc.fromCache(f.Name, f.Base64SHA1) {
break
}