diff --git a/daemon/HTTPServer.cpp b/daemon/HTTPServer.cpp index fce3052d..3f0fc6d8 100644 --- a/daemon/HTTPServer.cpp +++ b/daemon/HTTPServer.cpp @@ -1263,12 +1263,15 @@ namespace http { ident.FromBase32 (b32); auto dest = i2p::client::context.FindLocalDestination (ident); - if (dest) { + if (dest) + { std::size_t pos; pos = name.find (".i2p"); - if (pos == (name.length () - 4)) { + if (pos == (name.length () - 4)) + { pos = name.find (".b32.i2p"); - if (pos == std::string::npos) { + if (pos == std::string::npos) + { auto signatureLen = dest->GetIdentity ()->GetSignatureLen (); uint8_t * signature = new uint8_t[signatureLen]; char * sig = new char[signatureLen*2]; @@ -1280,16 +1283,17 @@ namespace http { sig[len] = 0; out << "#!sig=" << sig; s << "SUCCESS:
\r\n\r\n
\r\n
\r\n"; - delete[] signature, sig; - } else { + delete[] signature; + delete[] sig; + } + else s << "ERROR: Domain can't end with .b32.i2p\r\n
\r\n
\r\n"; - } - } else { + } + else s << "ERROR: Domain must end with .i2p\r\n
\r\n
\r\n"; - } - } else { + } + else s << "ERROR: Such destination is not found\r\n
\r\n
\r\n"; - } s << "Return to destination page\r\n"; return;