File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
components/server/src/code-sync Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -218,6 +218,11 @@ export class CodeSyncService {
218
218
res . sendStatus ( 204 ) ;
219
219
return ;
220
220
}
221
+ const content = req . body as string ;
222
+ if ( resourceKey === 'machines' && content . length > 200 ) {
223
+ res . sendStatus ( 413 ) ;
224
+ return ;
225
+ }
221
226
let latestRev = typeof req . headers [ 'If-Match' ] === 'string' ? req . headers [ 'If-Match' ] : undefined ;
222
227
if ( latestRev === fromTheiaRev ) {
223
228
latestRev = undefined ;
@@ -233,7 +238,6 @@ export class CodeSyncService {
233
238
request . setContentType ( contentType ) ;
234
239
const urlResponse = await util . promisify < UploadUrlRequest , UploadUrlResponse > ( this . blobs . uploadUrl . bind ( this . blobs ) ) ( request ) ;
235
240
const url = urlResponse . getUrl ( ) ;
236
- const content = req . body as string ;
237
241
const response = await fetch ( url , {
238
242
method : 'PUT' ,
239
243
body : content ,
You can’t perform that action at this time.
0 commit comments