It is now "documented behavior" (issue is closed), there are 2 mentions of 
this special case
here  https://golang.org/pkg/net/http/#FileServer
and here  https://golang.org/pkg/net/http/#ServeFile

On Wednesday, August 17, 2016 at 8:44:36 AM UTC+2, Howard Guo wrote:
>
> It is a known issue, file server treats index.html differently:
>
> https://github.com/golang/go/issues/9876
>
> On Tuesday, 16 August 2016 10:03:21 UTC+2, Howard Guo wrote:
>>
>> Hello fellow gophers.
>>
>> I'm starting a very trivial file server in a directory where there are 
>> files called "index.html" and "LICENSE":
>>
>> http.Handle("/", http.FileServer(http.Dir(".")))
>>
>> It has no trouble serving file LICENSE, however, the web server always 
>> responds with HTTP 301 when serving "index.html" - no matter what is 
>> written in the file.
>>
>> What's the magic over there? How to get it to serve index.html?
>>
>> Thanks.
>>
>> Regards,
>> Howard
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to