Closed MageSlayer closed 8 years ago
Long time ago, I got the same problem. Maybe It's caused by overwriting string:split()
by the other library.
this monkey patch is related: https://github.com/kernelsauce/turbo/blob/357cf6f41a033647fb86812cf9fe572611eed88b/turbo/util.lua#L40
As far as I know, Torch7/xlua defines string:split()
(different behavior): https://github.com/torch/xlua/blob/41308fe696bf8b0892f4ad4f9857d12a87a3f75e/init.lua#L689
Hm. That might be the case. Thanks for the hint. I'll check it tomorrow.
Sorry for noise. That was monkey patching indeed. So it's not related to Turbo.
Well, turbo should not assume that string.split does not exist, maybe make use of a local function?
I agree. I will change it around to just do the splitting in this function without any function. Im not sure if its so smart to remove the string:split completely, as it may break peoples things if changed at this point...
Well. Making it local will definitely help as string.split is too common to override. Thanks for pro-active attitude :)
I'm pretty sure people can re-implement string:split if they need to. Turbo should not pollute the global namespace at all now that I think about it.
Fixed.
Hi
The issue is about wrong web._StaticWebCache:get_mime(path) bevahiour. It always returns nil as mime_type. It is caused by invalid filename split. Instead of splitting on dot, it splits on every character. That is dot is used as regexp in fact. Tested on latest revision (8e1a1addaf725ba15b4566b2d1988a310d77d168)
See attached trivial patch for fix. mime-patch.zip