0

I'm trying to add css files /usr/local/share/libwebsockets-test-server/

but for some reason, I'm getting 406 Not Acceptable error.

I have checked the permission and both test.html and the css file inside css directory have 644 permission and both belong to root.

FWIW, CDN for jquery seems to work fine.

Many thanks in advance.

deojeff
  • 377
  • 6
  • 19

1 Answers1

0

In libwebsockets\test-server\test-server-http.c there are some lines:

#if 1
    /* this example server has no concept of directories */
    if (strchr((const char *)in + 1, '/')) {
        lws_return_http_status(wsi, HTTP_STATUS_NOT_ACCEPTABLE, NULL);
        goto try_to_reuse;
    }
#endif

Change the '#if 1' to '#if 0' and rebuild. See if that fixes the issue. It did for me. I assume that complicated dir layouts don't work well. But it could follow my dir structure fine.

Pat
  • 11
  • 1
  • Thanks. But, for me (IIRC), I had to add some lines in lib/server.c (or some other file) to *handle* the javascript file. And it worked. Edit: Remove code, apparently the formatting thingy doesn't work in comment replies. haha – deojeff Nov 15 '16 at 07:57