Skip to content
Snippets Groups Projects
Commit 6f1328c7 authored by Parker, Peter's avatar Parker, Peter
Browse files

Refs #22608 - Add more information to Mantid's "User-Agent" header.

We now conform to the standard format.  This change will help with server-side debugging when calling APIs.
parent 4f4c4d58
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@
#include "MantidKernel/DateAndTime.h"
#include "MantidKernel/Exception.h"
#include "MantidKernel/Logger.h"
#include "MantidKernel/MantidVersion.h"
// Poco
#include <Poco/Net/AcceptCertificateHandler.h>
......@@ -135,7 +136,11 @@ void InternetHelper::createRequest(Poco::URI &uri) {
m_request->setContentType(m_contentType);
}
m_request->set("User-Agent", "MANTID");
m_request->set(
"User-Agent",
// Use standard User-Agent format as per MDN documentation.
std::string("Mantid/") + MantidVersion::version()
);
if (m_method == "POST") {
// HTTP states that the 'Content-Length' header should not be included
// if the 'Transfer-Encoding' header is set. UNKNOWN_CONTENT_LENGTH
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment