Send M_UNKNOWN on all requests for now.

This commit is contained in:
Jordan Bancino 2022-09-16 11:49:21 -04:00
parent d0fb926f2a
commit d7a1f7411d

View file

@ -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;