@@ -92,7 +92,7 @@ public async Task<IHttpActionResult> GetByIdAsync(string id, string filter = nul
92
92
var organization = await GetOrganizationAsync ( model . OrganizationId ) ;
93
93
if ( organization == null )
94
94
return NotFound ( ) ;
95
-
95
+
96
96
if ( organization . IsSuspended || organization . RetentionDays > 0 && model . Date . UtcDateTime < SystemClock . UtcNow . SubtractDays ( organization . RetentionDays ) )
97
97
return PlanLimitReached ( "Unable to view event occurrence due to plan limits." ) ;
98
98
@@ -318,7 +318,7 @@ public async Task<IHttpActionResult> GetByReferenceIdAsync(string referenceId, s
318
318
var project = await GetProjectAsync ( projectId ) ;
319
319
if ( project == null )
320
320
return NotFound ( ) ;
321
-
321
+
322
322
var organization = await GetOrganizationAsync ( project . OrganizationId ) ;
323
323
if ( organization == null )
324
324
return NotFound ( ) ;
@@ -378,7 +378,7 @@ public async Task<IHttpActionResult> GetBySessionIdAsync(string sessionId, strin
378
378
var project = await GetProjectAsync ( projectId ) ;
379
379
if ( project == null )
380
380
return NotFound ( ) ;
381
-
381
+
382
382
var organization = await GetOrganizationAsync ( project . OrganizationId ) ;
383
383
if ( organization == null )
384
384
return NotFound ( ) ;
@@ -448,7 +448,7 @@ public async Task<IHttpActionResult> GetBySessionAsync(string projectId, string
448
448
var sf = new ExceptionlessSystemFilterQuery ( project , organization ) ;
449
449
return await GetInternalAsync ( sf , ti , $ "type:{ Event . KnownTypes . Session } { filter } ", sort , mode , page , limit , true ) ;
450
450
}
451
-
451
+
452
452
/// <summary>
453
453
/// Set user description
454
454
/// </summary>
@@ -566,12 +566,12 @@ public async Task<IHttpActionResult> RecordHeartbeatAsync(string projectId = nul
566
566
/// </summary>
567
567
/// <remarks>
568
568
/// You can create an event using query string parameters.
569
- ///
569
+ ///
570
570
/// Feature usage named build with a duration of 10:
571
571
/// <code><![CDATA[/events/submit?access_token=YOUR_API_KEY&type=usage&source=build&value=10]]></code>
572
572
/// OR
573
573
/// <code><![CDATA[/events/submit/usage?access_token=YOUR_API_KEY&source=build&value=10]]></code>
574
- ///
574
+ ///
575
575
/// Log with message, geo and extended data
576
576
/// <code><![CDATA[/events/submit?access_token=YOUR_API_KEY&type=log&message=Hello World&source=server01&geo=32.85,-96.9613&randomproperty=true]]></code>
577
577
/// OR
@@ -769,6 +769,18 @@ await _eventPostQueue.EnqueueAsync(new EventPostInfo {
769
769
// Set the project for the configuration response filter.
770
770
Request . SetProject ( project ) ;
771
771
772
+ if ( data . LongLength > Settings . Current . MaximumEventPostSize ) {
773
+ _logger . Error ( ) . Critical ( )
774
+ . Message ( "Attempting to enqueue events greater than the maxiumum queue size" )
775
+ . Project ( projectId )
776
+ . Identity ( ExceptionlessUser ? . EmailAddress )
777
+ . Property ( "User" , ExceptionlessUser )
778
+ . Property ( "Headers" , Request . Content . Headers )
779
+ . Property ( "Size" , data . LongLength )
780
+ . Property ( "MaximumEventPostSize" , Settings . Current . MaximumEventPostSize )
781
+ . SetActionContext ( ActionContext ) ;
782
+ }
783
+
772
784
string contentEncoding = Request . Content . Headers . ContentEncoding . ToString ( ) ;
773
785
bool isCompressed = contentEncoding == "gzip" || contentEncoding == "deflate" ;
774
786
if ( ! isCompressed && data . Length > 1000 ) {
@@ -819,7 +831,7 @@ public Task<IHttpActionResult> DeleteAsync(string ids) {
819
831
private Task < Organization > GetOrganizationAsync ( string organizationId , bool useCache = true ) {
820
832
if ( String . IsNullOrEmpty ( organizationId ) || ! CanAccessOrganization ( organizationId ) )
821
833
return null ;
822
-
834
+
823
835
return _organizationRepository . GetByIdAsync ( organizationId , useCache ) ;
824
836
}
825
837
@@ -833,7 +845,7 @@ private async Task<Project> GetProjectAsync(string projectId, bool useCache = tr
833
845
834
846
return project ;
835
847
}
836
-
848
+
837
849
private async Task < Stack > GetStackAsync ( string stackId , bool useCache = true ) {
838
850
if ( String . IsNullOrEmpty ( stackId ) )
839
851
return null ;
0 commit comments