🎨 加入只读模式配置
This commit is contained in:
parent
24d4654030
commit
f6a72ff464
|
@ -37,6 +37,11 @@ var logger = gulu.Log.NewLogger(os.Stdout)
|
||||||
|
|
||||||
// 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