Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/modules/httpd.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ configured.
httpd.start({
webroot = "<static file prefix>",
max_handlers = 20,
auto_index = httpd.INDEX_NONE || httpd.INDEX_ROOT || httpd.INDEX_ALL,
auto_index = httpd.INDEX_ALL,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removes the mention of the other index modes, I can't say I'm in favour of that 🙃

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns out that these are actually enums and shouldn't be or'ed together. Worse, the example uses || which is the logical or. Thus, this expression returns the first non-zero value!!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, logical OR, because you need to choose one of them. What's the correct syntax for that in this case, if not that? (genuine question, not a snarky comment)

})
```

Expand Down Expand Up @@ -288,7 +288,7 @@ nil
httpd.start({
webroot = "<static file prefix>",
max_handlers = 20,
auto_index = httpd.INDEX_NONE + httpd.INDEX_ROOT + httpd.INDEX_ALL,
auto_index = httpd.INDEX_ALL,
})

function echo_ws(req, ws)
Expand Down