🎨 加入只读模式配置
This commit is contained in:
parent
9076912b9d
commit
58611c8f1e
|
@ -24,11 +24,17 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/88250/gulu"
|
"github.com/88250/gulu"
|
||||||
|
"github.com/88250/wide/conf"
|
||||||
"github.com/88250/wide/session"
|
"github.com/88250/wide/session"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AutocompleteHandler handles request of code autocompletion.
|
// AutocompleteHandler handles request of code autocompletion.
|
||||||
func AutocompleteHandler(w http.ResponseWriter, r *http.Request) {
|
func AutocompleteHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
if conf.Wide.ReadOnly {
|
||||||
|
http.Error(w, "Forbidden", http.StatusForbidden)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
var args map[string]interface{}
|
var args map[string]interface{}
|
||||||
if err := json.NewDecoder(r.Body).Decode(&args); err != nil {
|
if err := json.NewDecoder(r.Body).Decode(&args); err != nil {
|
||||||
logger.Error(err)
|
logger.Error(err)
|
||||||
|
|
Loading…
Reference in New Issue