aboutsummaryrefslogtreecommitdiff
path: root/src/qt/paymentserver.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2013-08-28 11:16:56 +1000
committerGavin Andresen <gavinandresen@gmail.com>2013-08-28 11:48:39 +1000
commitb773da064d1da3a4c2054f5bbf7c04fcac72694b (patch)
tree386a1d4ec583ae58560e355e4de2ed3b8c7858e7 /src/qt/paymentserver.cpp
parentbb7d0fc12fcfbb2a91e39cb49f2a0873344dbae0 (diff)
Set Accept: application/bitcoin-paymentrequest header
Suggestion from BitPay: set an Accept: HTTP header when fetching payment requests / payment ACKs.
Diffstat (limited to 'src/qt/paymentserver.cpp')
-rw-r--r--src/qt/paymentserver.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp
index a9f71315a9..75a8c03c01 100644
--- a/src/qt/paymentserver.cpp
+++ b/src/qt/paymentserver.cpp
@@ -48,6 +48,8 @@ using namespace boost;
const int BITCOIN_IPC_CONNECT_TIMEOUT = 1000; // milliseconds
const QString BITCOIN_IPC_PREFIX("bitcoin:");
+const char* BITCOIN_REQUEST_MIMETYPE = "application/bitcoin-paymentrequest";
+const char* BITCOIN_PAYMENTACK_MIMETYPE = "application/bitcoin-paymentack";
X509_STORE* PaymentServer::certStore = NULL;
void PaymentServer::freeCertStore()
@@ -500,6 +502,7 @@ PaymentServer::fetchRequest(const QUrl& url)
netRequest.setAttribute(QNetworkRequest::User, "PaymentRequest");
netRequest.setUrl(url);
netRequest.setRawHeader("User-Agent", CLIENT_NAME.c_str());
+ netRequest.setRawHeader("Accept", BITCOIN_REQUEST_MIMETYPE);
netManager->get(netRequest);
}
@@ -515,6 +518,7 @@ PaymentServer::fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipient, QB
netRequest.setUrl(QString::fromStdString(details.payment_url()));
netRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/bitcoin-payment");
netRequest.setRawHeader("User-Agent", CLIENT_NAME.c_str());
+ netRequest.setRawHeader("Accept", BITCOIN_PAYMENTACK_MIMETYPE);
payments::Payment payment;
payment.set_merchant_data(details.merchant_data());