Not able to repro this either, is this failing for all Requests or only specific requests? If it’s a specific request can provide an example of the Request it fails for?
Also does changing it to access the referrer through the Headers still cause the error?
Going to need a stand-alone repro for this as I haven’t been able to repro this for either Normal Servoce or Error requests as seen in RequestLogsFeatureTests.cs.
It appears that’s something disposing/short-circuiting the Request which is preventing access to the HTTP Request context.
I just went to review this and found that I can’t reproduce it now either. The only thing I’ve changed (the SS service has been running in debug mode ever since) is I’ve swapped out the JsonServiceClient for Angular’s HttpClient…
I will swap the JsonServiceClient back in and see if that helps me recreate it…
Then I investigated and found that its the OPTIONS request sent by the JsonServiceClient (my HttpClient call doesn’t send them).
I then used Postman to send the same requests, GET works but OPTIONS causes the exception…
I’ve added a test for OPTIONS requests with CorsFeature enabled which short-circuits requests which also logs without error, but the default Memory Logger also checks if the Response is closed for additional properties to log, although it’s able to read the Referrer from request.Headers[HttpHeaders.Referer] fine.