Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: KSP-SpaceDock/SpaceDock-Extras
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: af7dd4940968
Choose a base ref
...
head repository: KSP-SpaceDock/SpaceDock-Extras
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 31c10e6f42be
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Apr 29, 2017

  1. Cache browse

    Dorian Stoll committed Apr 29, 2017
    Copy the full SHA
    531f7fd View commit details
  2. Limit recursion

    Dorian Stoll committed Apr 29, 2017
    Copy the full SHA
    31c10e6 View commit details
Showing with 5 additions and 4 deletions.
  1. +3 −2 plugins/adapter/adapter.go
  2. +2 −2 plugins/search/routes.go
5 changes: 3 additions & 2 deletions plugins/adapter/adapter.go
Original file line number Diff line number Diff line change
@@ -9,15 +9,15 @@ package adapter

import (
"SpaceDock"
"SpaceDock/objects"
"SpaceDock/routes"
"SpaceDock/utils"
"SpaceDock/objects"
"github.com/spf13/cast"
"gopkg.in/kataras/iris.v6"
)

func init() {
routes.Register(routes.GET, "/api/adapter/mods/:modid", mods_adapter)
routes.Register(routes.GET, "/api/adapter/mods/:modid", middleware.Recursion(0), mods_adapter)
}

/*
@@ -36,6 +36,7 @@ func mods_adapter(ctx *iris.Context) {
utils.WriteJSON(ctx, iris.StatusNotFound, utils.Error("The modid is invalid").Code(2130))
return
}
SpaceDock.Database.Model(mod).Related(&(mod.Game), "Game")
if ctx.URLParam("callback") != "" {
ctx.Redirect("/api/mods/" + mod.Game.Short + "/" + cast.ToString(modid) + "?callback=" + ctx.URLParam("callback"), iris.StatusPermanentRedirect)
return
4 changes: 2 additions & 2 deletions plugins/search/routes.go
Original file line number Diff line number Diff line change
@@ -19,8 +19,8 @@ import (
)

func init() {
routes.Register(routes.GET, "/api/browse/:gameshort", browse_mod)
routes.Register(routes.GET, "/api/browse/:gameshort/:mode", browse_mod_mode)
routes.Register(routes.GET, "/api/browse/:gameshort", middleware.Cache, browse_mod)
routes.Register(routes.GET, "/api/browse/:gameshort/:mode", middleware.Cache, browse_mod_mode)
}

/*