mirror of
https://github.com/benbusby/farside.git
synced 2025-04-25 13:10:02 +00:00
Update breezewiki routing behavior, update readme
BreezeWiki requires the subdomain of a fandom link to be preserved when routing, otherwise the redirect doesn't work correctly. Cleaned up readme examples
This commit is contained in:
parent
3d52cddc66
commit
6e64a93fd1
7 changed files with 33 additions and 39 deletions
|
@ -86,7 +86,17 @@ func routing(w http.ResponseWriter, r *http.Request, jsEnabled bool) {
|
|||
return
|
||||
}
|
||||
|
||||
instance, err := db.GetInstance(target)
|
||||
var servicePath string
|
||||
if target == "breezewiki" {
|
||||
// Breezewiki requires the subdomain of the instance to be
|
||||
// preserved for correct routing
|
||||
splitDomain := strings.Split(path, ".")
|
||||
if len(splitDomain) > 2 {
|
||||
servicePath = strings.Split(path, ".")[0]
|
||||
}
|
||||
}
|
||||
|
||||
instance, err := db.GetInstance(target, servicePath)
|
||||
if err != nil {
|
||||
log.Printf("Error fetching instance from db: %v\n", err)
|
||||
http.Error(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue