mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-28 17:23:09 -06:00
Merge branch 'matrix-org:master' into master
This commit is contained in:
commit
f4ad3edc37
|
|
@ -212,7 +212,11 @@ func main() {
|
||||||
base.PublicMediaAPIMux,
|
base.PublicMediaAPIMux,
|
||||||
)
|
)
|
||||||
|
|
||||||
wsUpgrader := websocket.Upgrader{}
|
wsUpgrader := websocket.Upgrader{
|
||||||
|
CheckOrigin: func(_ *http.Request) bool {
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
}
|
||||||
httpRouter := mux.NewRouter().SkipClean(true).UseEncodedPath()
|
httpRouter := mux.NewRouter().SkipClean(true).UseEncodedPath()
|
||||||
httpRouter.PathPrefix(httputil.InternalPathPrefix).Handler(base.InternalAPIMux)
|
httpRouter.PathPrefix(httputil.InternalPathPrefix).Handler(base.InternalAPIMux)
|
||||||
httpRouter.PathPrefix(httputil.PublicClientPathPrefix).Handler(base.PublicClientAPIMux)
|
httpRouter.PathPrefix(httputil.PublicClientPathPrefix).Handler(base.PublicClientAPIMux)
|
||||||
|
|
|
||||||
|
|
@ -685,7 +685,7 @@ func (r *downloadRequest) GetContentLengthAndReader(contentLengthHeader string,
|
||||||
r.Logger.WithError(parseErr).Warn("Failed to parse content length")
|
r.Logger.WithError(parseErr).Warn("Failed to parse content length")
|
||||||
return 0, nil, fmt.Errorf("strconv.ParseInt: %w", parseErr)
|
return 0, nil, fmt.Errorf("strconv.ParseInt: %w", parseErr)
|
||||||
}
|
}
|
||||||
if parsedLength > int64(maxFileSizeBytes) {
|
if maxFileSizeBytes > 0 && parsedLength > int64(maxFileSizeBytes) {
|
||||||
return 0, nil, fmt.Errorf(
|
return 0, nil, fmt.Errorf(
|
||||||
"remote file size (%d bytes) exceeds locally configured max media size (%d bytes)",
|
"remote file size (%d bytes) exceeds locally configured max media size (%d bytes)",
|
||||||
parsedLength, maxFileSizeBytes,
|
parsedLength, maxFileSizeBytes,
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,7 @@ func (d *Database) AddState(
|
||||||
stateBlockNIDs []types.StateBlockNID,
|
stateBlockNIDs []types.StateBlockNID,
|
||||||
state []types.StateEntry,
|
state []types.StateEntry,
|
||||||
) (stateNID types.StateSnapshotNID, err error) {
|
) (stateNID types.StateSnapshotNID, err error) {
|
||||||
if len(stateBlockNIDs) > 0 {
|
if len(stateBlockNIDs) > 0 && len(state) > 0 {
|
||||||
// Check to see if the event already appears in any of the existing state
|
// Check to see if the event already appears in any of the existing state
|
||||||
// blocks. If it does then we should not add it again, as this will just
|
// blocks. If it does then we should not add it again, as this will just
|
||||||
// result in excess state blocks and snapshots.
|
// result in excess state blocks and snapshots.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue