Title: Error processing response in Django middleware when another request middleware short-circuits · Issue #61 · microsoft/ApplicationInsights-Python · GitHub
Open Graph Title: Error processing response in Django middleware when another request middleware short-circuits · Issue #61 · microsoft/ApplicationInsights-Python
X Title: Error processing response in Django middleware when another request middleware short-circuits · Issue #61 · microsoft/ApplicationInsights-Python
Description: The Django insights middleware crashes in process_response when a middleware short-circuits when processing the request because the process_request hasn't be run. For example, the CommonMiddleware will short-circuit to affix a missing tr...
Open Graph Description: The Django insights middleware crashes in process_response when a middleware short-circuits when processing the request because the process_request hasn't be run. For example, the CommonMiddleware ...
X Description: The Django insights middleware crashes in process_response when a middleware short-circuits when processing the request because the process_request hasn't be run. For example, the CommonMiddlew...
Opengraph URL: https://github.com/microsoft/ApplicationInsights-Python/issues/61
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Error processing response in Django middleware when another request middleware short-circuits","articleBody":"The Django insights middleware crashes in `process_response` when a middleware short-circuits when processing the request because the `process_request` hasn't be run.\r\n\r\nFor example, the `CommonMiddleware` will short-circuit to affix a missing trailing slash with a 301 Moved Permanently response if the client accesses `/admin` when `/admin/` is the registered URL\r\n\r\n```\r\nMIDDLEWARE_CLASSES = [\r\n # ...\r\n 'django.middleware.common.CommonMiddleware',\r\n # ...\r\n 'applicationinsights.django.ApplicationInsightsMiddleware'\r\n]\r\n```\r\n\r\nThe reasonable solution is probably to check for the presence of the `appinsights` attribute in the `process_response` method. The method can submit the event without the `duration` field set, if the `appinsights` attribute is missing. ","author":{"url":"https://github.com/twschiller","@type":"Person","name":"twschiller"},"datePublished":"2017-10-31T22:31:46Z","url":"https://github.com/microsoft/ApplicationInsights-Python/issues/61"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:731581cc-1f09-43f9-69f8-bf547431e468 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9B8C:3047DC:131753:196568:6B04B18A |
| html-safe-nonce | a92f506904ff81993e8e4e96fef807acb276dff0012af43da0e06b85a877006a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QjhDOjMwNDdEQzoxMzE3NTM6MTk2NTY4OjZCMDRCMThBIiwidmlzaXRvcl9pZCI6IjM0NDMwMjUyNDYxNjE5MjM5NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 87d902b148329beaee2b6066a734d6492330d0b9e1407ca07074dbbe1f1091b3 |
| hovercard-subject-tag | issue:270139669 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/ApplicationInsights-Python/61/issue_layout |
| twitter:image | https://opengraph.githubassets.com/14adbc044efd74f5cb14d0af450faa926559196ab6984728bec7fa62743256e0/microsoft/ApplicationInsights-Python/issues/61 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/14adbc044efd74f5cb14d0af450faa926559196ab6984728bec7fa62743256e0/microsoft/ApplicationInsights-Python/issues/61 |
| og:image:alt | The Django insights middleware crashes in process_response when a middleware short-circuits when processing the request because the process_request hasn't be run. For example, the CommonMiddleware ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | twschiller |
| hostname | github.com |
| expected-hostname | github.com |
| None | f1d110ea058a0915c1d8aa3fc2069fa15801e128f591e5762525abe77490ecb1 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/ApplicationInsights-Python git https://github.com/microsoft/ApplicationInsights-Python.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 26877260 |
| octolytics-dimension-repository_nwo | microsoft/ApplicationInsights-Python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 26877260 |
| octolytics-dimension-repository_network_root_nwo | microsoft/ApplicationInsights-Python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ffa22a65e4c46d376940fe34b05e6a7e9c7fdb9b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width