mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 05:50:56 +00:00
Merge commit 'efbde1ee77517486eac03e814e01d724ddad18e6' into develop
This commit is contained in:
commit
715c2c4312
@ -337,13 +337,16 @@ func (input *BeegoInput) Cookie(key string) string {
|
||||
}
|
||||
|
||||
// Session returns current session item value by a given key.
|
||||
// if non-existed, return empty string.
|
||||
// if non-existed, return nil.
|
||||
func (input *BeegoInput) Session(key interface{}) interface{} {
|
||||
return input.CruSession.Get(key)
|
||||
}
|
||||
|
||||
// CopyBody returns the raw request body data as bytes.
|
||||
func (input *BeegoInput) CopyBody(MaxMemory int64) []byte {
|
||||
if input.Context.Request.Body == nil {
|
||||
return []byte{}
|
||||
}
|
||||
safe := &io.LimitedReader{R: input.Context.Request.Body, N: MaxMemory}
|
||||
requestbody, _ := ioutil.ReadAll(safe)
|
||||
input.Context.Request.Body.Close()
|
||||
|
@ -117,6 +117,7 @@ type Schema struct {
|
||||
Description string `json:"description,omitempty"`
|
||||
Required []string `json:"required,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
Items *Propertie `json:"items,omitempty"`
|
||||
Properties map[string]Propertie `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user