Skip to content

Instantly share code, notes, and snippets.

@ego008
Created April 22, 2018 14:05
Show Gist options
  • Save ego008/4acdfa774c4b8b09b78123f68441b151 to your computer and use it in GitHub Desktop.
Save ego008/4acdfa774c4b8b09b78123f68441b151 to your computer and use it in GitHub Desktop.
if strings.HasPrefix(path, "/.well-known/acme-challenge/") {
filePath := strings.Replace(path, "/.well-known/acme-challenge/", "", -1)
buf, err := ioutil.ReadFile("static/"+filePath)
if err != nil {
ctx.NotFound()
ctx.SetConnectionClose()
return
}
ctx.Write(buf)
ctx.SetConnectionClose()
return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment