Fix errors with index handling; permit multiple indexes.#98
Fix errors with index handling; permit multiple indexes.#98smcmurray wants to merge 14 commits intokoajs:masterfrom smcmurray:multi-index
Conversation
|
@coderhaoxin @jonathanong This PR has some tests that I think will highlight weaknesses in the current code. Even if you don't like my solution, the current code should be fixed. |
can you split these tests code to a separate PR ~ BTW, do you really need such a big change to implement your feature ? 😢 |
|
@coderhaoxin My new feature accounts for only about 1 line of that code. The rest is a bug fix. The reality is that you currently support an open-ended number of index files, but your code doesn't account for that correctly. This PR also supports an open-ended number of index files, but accounts for them all correctly (so I say). I could alter lines 76-77 to reduce the possible permutations back to current spec. But I would leave the rest of the code. commit 46c4c93 has the tests to expose current misbehavior. (I haven't actually tested the tests.) |
This allows options.index to be an array of indexes, prioritized by list order.
It also removes a pretty obscure error whereby
could serve
path/to/index.html/index