1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00

Fix bug with one letter routes

This commit is contained in:
Zack Scholl 2017-11-13 11:32:32 -07:00
parent 7cc1eccb83
commit 55368b1c1a

View File

@ -285,7 +285,7 @@ func handlePageRequest(c *gin.Context) {
versionsChangeSums = reverseSliceInt(versionsChangeSums)
}
if command[0:3] == "/ra" {
if len(command) > 3 && command[0:3] == "/ra" {
c.Writer.Header().Set("Content-Type", contentType(p.Name))
c.Writer.Header().Set("Access-Control-Allow-Origin", "*")
c.Writer.Header().Set("Access-Control-Max-Age", "86400")