fix main.css not being served on /topics/
panic when we try to reference an agent which doesn't exist in gen router init
This commit is contained in:
parent
1f0713bb27
commit
de2221f243
|
@ -873,15 +873,22 @@ func init() {
|
||||||
co.SetReverseAgentMapEnum(reverseAgentMapEnum)
|
co.SetReverseAgentMapEnum(reverseAgentMapEnum)
|
||||||
co.SetOSMapEnum(osMapEnum)
|
co.SetOSMapEnum(osMapEnum)
|
||||||
co.SetReverseOSMapEnum(reverseOSMapEnum)
|
co.SetReverseOSMapEnum(reverseOSMapEnum)
|
||||||
c.Chrome = agentMapEnum["chrome"]
|
|
||||||
c.Firefox = agentMapEnum["firefox"]
|
g := func(n string) int {
|
||||||
ame := agentMapEnum
|
a, ok := agentMapEnum[n]
|
||||||
|
if !ok {
|
||||||
|
panic("name not found in agentMapEnum")
|
||||||
|
}
|
||||||
|
return a
|
||||||
|
}
|
||||||
|
c.Chrome = g("chrome")
|
||||||
|
c.Firefox = g("firefox")
|
||||||
c.SimpleBots = []int{
|
c.SimpleBots = []int{
|
||||||
ame["semrush"],
|
g("semrush"),
|
||||||
ame["ahrefs"],
|
g("ahrefs"),
|
||||||
ame["python"],
|
g("python"),
|
||||||
ame["go"],
|
//g("go"),
|
||||||
ame["curl"],
|
g("curl"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -465,15 +465,22 @@ func init() {
|
||||||
co.SetReverseAgentMapEnum(reverseAgentMapEnum)
|
co.SetReverseAgentMapEnum(reverseAgentMapEnum)
|
||||||
co.SetOSMapEnum(osMapEnum)
|
co.SetOSMapEnum(osMapEnum)
|
||||||
co.SetReverseOSMapEnum(reverseOSMapEnum)
|
co.SetReverseOSMapEnum(reverseOSMapEnum)
|
||||||
c.Chrome = agentMapEnum["chrome"]
|
|
||||||
c.Firefox = agentMapEnum["firefox"]
|
g := func(n string) int {
|
||||||
ame := agentMapEnum
|
a, ok := agentMapEnum[n]
|
||||||
|
if !ok {
|
||||||
|
panic("name not found in agentMapEnum")
|
||||||
|
}
|
||||||
|
return a
|
||||||
|
}
|
||||||
|
c.Chrome = g("chrome")
|
||||||
|
c.Firefox = g("firefox")
|
||||||
c.SimpleBots = []int{
|
c.SimpleBots = []int{
|
||||||
ame["semrush"],
|
g("semrush"),
|
||||||
ame["ahrefs"],
|
g("ahrefs"),
|
||||||
ame["python"],
|
g("python"),
|
||||||
ame["go"],
|
//g("go"),
|
||||||
ame["curl"],
|
g("curl"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue