mirror of
https://github.com/xmrig/xmrig.git
synced 2024-11-18 10:01:06 +00:00
Added "/2/config" alias for config API.
This commit is contained in:
parent
46f1661fd9
commit
3c5cb142cb
1 changed files with 10 additions and 2 deletions
|
@ -57,6 +57,14 @@
|
|||
#endif
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
static const char *kConfigPathV1 = "/1/config";
|
||||
static const char *kConfigPathV2 = "/2/config";
|
||||
|
||||
} // namespace xmrig
|
||||
|
||||
|
||||
class xmrig::BasePrivate
|
||||
{
|
||||
public:
|
||||
|
@ -296,7 +304,7 @@ void xmrig::Base::onFileChanged(const String &fileName)
|
|||
void xmrig::Base::onRequest(IApiRequest &request)
|
||||
{
|
||||
if (request.method() == IApiRequest::METHOD_GET) {
|
||||
if (request.url() == "/1/config") {
|
||||
if (request.url() == kConfigPathV1 || request.url() == kConfigPathV2) {
|
||||
if (request.isRestricted()) {
|
||||
return request.done(403);
|
||||
}
|
||||
|
@ -306,7 +314,7 @@ void xmrig::Base::onRequest(IApiRequest &request)
|
|||
}
|
||||
}
|
||||
else if (request.method() == IApiRequest::METHOD_PUT || request.method() == IApiRequest::METHOD_POST) {
|
||||
if (request.url() == "/1/config") {
|
||||
if (request.url() == kConfigPathV1 || request.url() == kConfigPathV2) {
|
||||
request.accept();
|
||||
|
||||
if (!reload(request.json())) {
|
||||
|
|
Loading…
Reference in a new issue