forked from lda/telodendria
Send M_UNKNOWN on all requests for now.
This commit is contained in:
parent
d0fb926f2a
commit
d7a1f7411d
1 changed files with 11 additions and 3 deletions
14
src/Matrix.c
14
src/Matrix.c
|
@ -41,11 +41,12 @@ MatrixHttpHandler(HttpServerContext * context, void *argp)
|
||||||
char *key;
|
char *key;
|
||||||
char *val;
|
char *val;
|
||||||
|
|
||||||
|
HashMap *response;
|
||||||
|
|
||||||
Log(lc, LOG_MESSAGE, "%s %s",
|
Log(lc, LOG_MESSAGE, "%s %s",
|
||||||
HttpRequestMethodToString(HttpRequestMethodGet(context)),
|
HttpRequestMethodToString(HttpRequestMethodGet(context)),
|
||||||
HttpRequestPath(context));
|
HttpRequestPath(context));
|
||||||
|
|
||||||
|
|
||||||
LogConfigIndent(lc);
|
LogConfigIndent(lc);
|
||||||
Log(lc, LOG_DEBUG, "Request headers:");
|
Log(lc, LOG_DEBUG, "Request headers:");
|
||||||
|
|
||||||
|
@ -78,9 +79,16 @@ MatrixHttpHandler(HttpServerContext * context, void *argp)
|
||||||
goto finish;
|
goto finish;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TODO: Route requests here */
|
||||||
|
|
||||||
HttpSendHeaders(context);
|
HttpSendHeaders(context);
|
||||||
stream = HttpStream(context);
|
stream = HttpStream(context);
|
||||||
fprintf(stream, "{}\n");
|
|
||||||
|
response = MatrixErrorCreate(M_UNKNOWN);
|
||||||
|
JsonEncode(response, stream);
|
||||||
|
fprintf(stream, "\n");
|
||||||
|
|
||||||
|
JsonFree(response);
|
||||||
|
|
||||||
finish:
|
finish:
|
||||||
stream = HttpStream(context);
|
stream = HttpStream(context);
|
||||||
|
@ -90,7 +98,7 @@ finish:
|
||||||
}
|
}
|
||||||
|
|
||||||
HashMap *
|
HashMap *
|
||||||
MatrixCreateError(MatrixError errorArg)
|
MatrixErrorCreate(MatrixError errorArg)
|
||||||
{
|
{
|
||||||
HashMap *errorObj;
|
HashMap *errorObj;
|
||||||
char *errcode;
|
char *errcode;
|
||||||
|
|
Loading…
Reference in a new issue