paymentserver: use own HTML-esc / add new header const
- make processPaymentRequest() use our own HTML-escaping function from GUIUtil - make string "application/bitcoin-payment" a constant (below similar constant strings in the .cpp file)
This commit is contained in:
parent
8a041f494f
commit
06dfd23d41
1 changed files with 3 additions and 6 deletions
|
@ -48,6 +48,7 @@ const int BITCOIN_IPC_CONNECT_TIMEOUT = 1000; // milliseconds
|
||||||
const QString BITCOIN_IPC_PREFIX("bitcoin:");
|
const QString BITCOIN_IPC_PREFIX("bitcoin:");
|
||||||
const char* BITCOIN_REQUEST_MIMETYPE = "application/bitcoin-paymentrequest";
|
const char* BITCOIN_REQUEST_MIMETYPE = "application/bitcoin-paymentrequest";
|
||||||
const char* BITCOIN_PAYMENTACK_MIMETYPE = "application/bitcoin-paymentack";
|
const char* BITCOIN_PAYMENTACK_MIMETYPE = "application/bitcoin-paymentack";
|
||||||
|
const char* BITCOIN_PAYMENTACK_CONTENTTYPE = "application/bitcoin-payment";
|
||||||
|
|
||||||
X509_STORE* PaymentServer::certStore = NULL;
|
X509_STORE* PaymentServer::certStore = NULL;
|
||||||
void PaymentServer::freeCertStore()
|
void PaymentServer::freeCertStore()
|
||||||
|
@ -471,11 +472,7 @@ bool PaymentServer::processPaymentRequest(PaymentRequestPlus& request, QList<Sen
|
||||||
recipients.append(SendCoinsRecipient());
|
recipients.append(SendCoinsRecipient());
|
||||||
recipients[i].amount = sendingTo.second;
|
recipients[i].amount = sendingTo.second;
|
||||||
QString memo = QString::fromStdString(request.getDetails().memo());
|
QString memo = QString::fromStdString(request.getDetails().memo());
|
||||||
#if QT_VERSION < 0x050000
|
recipients[i].label = GUIUtil::HtmlEscape(memo);
|
||||||
recipients[i].label = Qt::escape(memo);
|
|
||||||
#else
|
|
||||||
recipients[i].label = memo.toHtmlEscaped();
|
|
||||||
#endif
|
|
||||||
CTxDestination dest;
|
CTxDestination dest;
|
||||||
if (ExtractDestination(sendingTo.first, dest)) {
|
if (ExtractDestination(sendingTo.first, dest)) {
|
||||||
if (i == 0) // Tie request to first pay-to, we don't want multiple ACKs
|
if (i == 0) // Tie request to first pay-to, we don't want multiple ACKs
|
||||||
|
@ -518,7 +515,7 @@ void PaymentServer::fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipien
|
||||||
QNetworkRequest netRequest;
|
QNetworkRequest netRequest;
|
||||||
netRequest.setAttribute(QNetworkRequest::User, "PaymentACK");
|
netRequest.setAttribute(QNetworkRequest::User, "PaymentACK");
|
||||||
netRequest.setUrl(QString::fromStdString(details.payment_url()));
|
netRequest.setUrl(QString::fromStdString(details.payment_url()));
|
||||||
netRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/bitcoin-payment");
|
netRequest.setHeader(QNetworkRequest::ContentTypeHeader, BITCOIN_PAYMENTACK_CONTENTTYPE);
|
||||||
netRequest.setRawHeader("User-Agent", CLIENT_NAME.c_str());
|
netRequest.setRawHeader("User-Agent", CLIENT_NAME.c_str());
|
||||||
netRequest.setRawHeader("Accept", BITCOIN_PAYMENTACK_MIMETYPE);
|
netRequest.setRawHeader("Accept", BITCOIN_PAYMENTACK_MIMETYPE);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue