René's URL Explorer Experiment


Title: [APPSEC]: report blocking_response payload and status code on blocked response by florentinl · Pull Request #656 · DataDog/datadog-lambda-python · GitHub

Open Graph Title: [APPSEC]: report blocking_response payload and status code on blocked response by florentinl · Pull Request #656 · DataDog/datadog-lambda-python

X Title: [APPSEC]: report blocking_response payload and status code on blocked response by florentinl · Pull Request #656 · DataDog/datadog-lambda-python

Description: What does this PR do? This PR ensures that when a request is blocked, the reported captured response and http.status_code comes from the blocking_response instead of the response. Motivation Currently, when enabling Appsec and a request is blocked. The span will still report the status code of the response that was blocked instead of the automatic blocking response and if the request was blocked before the function handler was called the default value of 502 would be returned. Testing Guidelines updated unit tests to avoid regressions Additional Notes I am making a pass of manual testing before making appsec through the tracer the default and spot this bug Types of Changes Bug fix New feature Breaking change Misc (docs, refactoring, dependency upgrade, etc.) Check all that apply This PR's description is comprehensive This PR contains breaking changes that are documented in the description This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future This PR impacts documentation, and it has been updated (or a ticket has been logged) This PR's changes are covered by the automated tests This PR collects user input/sensitive content into Datadog This PR passes the integration tests (ask a Datadog member to run the tests)

Open Graph Description: What does this PR do? This PR ensures that when a request is blocked, the reported captured response and http.status_code comes from the blocking_response instead of the response. Motivation Curren...

X Description: What does this PR do? This PR ensures that when a request is blocked, the reported captured response and http.status_code comes from the blocking_response instead of the response. Motivation Curren...

Opengraph URL: https://github.com/DataDog/datadog-lambda-python/pull/656

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:90ac097e-149f-6f6a-f058-7144feac9070
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id82B2:F68EB:2B4124:38042B:699067BA
html-safe-nonce2a1adff9c90fc954553f1ac6f4b030c0ff701b2a23d5bdca2207155e90e991a1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MkIyOkY2OEVCOjJCNDEyNDozODA0MkI6Njk5MDY3QkEiLCJ2aXNpdG9yX2lkIjoiNjk2MzAzMzQwNDc1NDM4ODkyMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacfb917a686f4b8ce1aea0b46b4302f88455832098153a2a90809f88f55e030ef9
hovercard-subject-tagpull_request:2808134511
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/DataDog/datadog-lambda-python/pull/656/files
twitter:imagehttps://avatars.githubusercontent.com/u/101594032?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/101594032?s=400&v=4
og:image:altWhat does this PR do? This PR ensures that when a request is blocked, the reported captured response and http.status_code comes from the blocking_response instead of the response. Motivation Curren...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/DataDog/datadog-lambda-python git https://github.com/DataDog/datadog-lambda-python.git
octolytics-dimension-user_id365230
octolytics-dimension-user_loginDataDog
octolytics-dimension-repository_id183265904
octolytics-dimension-repository_nwoDataDog/datadog-lambda-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id183265904
octolytics-dimension-repository_network_root_nwoDataDog/datadog-lambda-python
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release3b33c5aedc9808f45bc5fcf0b1e4404cf749dac7
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/DataDog/datadog-lambda-python/pull/656/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FDataDog%2Fdatadog-lambda-python%2Fpull%2F656%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FDataDog%2Fdatadog-lambda-python%2Fpull%2F656%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=DataDog%2Fdatadog-lambda-python
Reloadhttps://github.com/DataDog/datadog-lambda-python/pull/656/files
Reloadhttps://github.com/DataDog/datadog-lambda-python/pull/656/files
Reloadhttps://github.com/DataDog/datadog-lambda-python/pull/656/files
DataDog https://github.com/DataDog
datadog-lambda-pythonhttps://github.com/DataDog/datadog-lambda-python
Notifications https://github.com/login?return_to=%2FDataDog%2Fdatadog-lambda-python
Fork 47 https://github.com/login?return_to=%2FDataDog%2Fdatadog-lambda-python
Star 97 https://github.com/login?return_to=%2FDataDog%2Fdatadog-lambda-python
Code https://github.com/DataDog/datadog-lambda-python
Issues 5 https://github.com/DataDog/datadog-lambda-python/issues
Pull requests 12 https://github.com/DataDog/datadog-lambda-python/pulls
Actions https://github.com/DataDog/datadog-lambda-python/actions
Security 0 https://github.com/DataDog/datadog-lambda-python/security
Insights https://github.com/DataDog/datadog-lambda-python/pulse
Code https://github.com/DataDog/datadog-lambda-python
Issues https://github.com/DataDog/datadog-lambda-python/issues
Pull requests https://github.com/DataDog/datadog-lambda-python/pulls
Actions https://github.com/DataDog/datadog-lambda-python/actions
Security https://github.com/DataDog/datadog-lambda-python/security
Insights https://github.com/DataDog/datadog-lambda-python/pulse
Sign up for GitHub https://github.com/signup?return_to=%2FDataDog%2Fdatadog-lambda-python%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FDataDog%2Fdatadog-lambda-python%2Fissues%2Fnew%2Fchoose
florentinlhttps://github.com/florentinl
mainhttps://github.com/DataDog/datadog-lambda-python/tree/main
florentinl/fix-status-code-collection-on-blocked-responsehttps://github.com/DataDog/datadog-lambda-python/tree/florentinl/fix-status-code-collection-on-blocked-response
Conversation 3 https://github.com/DataDog/datadog-lambda-python/pull/656
Commits 1 https://github.com/DataDog/datadog-lambda-python/pull/656/commits
Checks 26 https://github.com/DataDog/datadog-lambda-python/pull/656/checks
Files changed https://github.com/DataDog/datadog-lambda-python/pull/656/files
Please reload this pagehttps://github.com/DataDog/datadog-lambda-python/pull/656/files
[APPSEC]: report blocking_response payload and status code on blocked response https://github.com/DataDog/datadog-lambda-python/pull/656/files#top
Show all changes 1 commit https://github.com/DataDog/datadog-lambda-python/pull/656/files
19fcf5f fix(appsec): perform _after extractions on the blocking_response florentinl Sep 9, 2025 https://github.com/DataDog/datadog-lambda-python/pull/656/commits/19fcf5f75d8de4b98d59b2f4afe6221f13a8a27d
Clear filters https://github.com/DataDog/datadog-lambda-python/pull/656/files
Please reload this pagehttps://github.com/DataDog/datadog-lambda-python/pull/656/files
Please reload this pagehttps://github.com/DataDog/datadog-lambda-python/pull/656/files
wrapper.py https://github.com/DataDog/datadog-lambda-python/pull/656/files#diff-5efc779a7e3c73ebd812eb62ff5dce68db1e0ed9ef9765bb076638733e8c5ae6
test_wrapper.py https://github.com/DataDog/datadog-lambda-python/pull/656/files#diff-04c66d7f4e31da0ce6071254060c6f5f2fb97c7b05883fc354f02d3472cb4f01
https://github.com/DataDog/datadog-lambda-python/blob/main/.github/CODEOWNERS#L1
datadog_lambda/wrapper.pyhttps://github.com/DataDog/datadog-lambda-python/pull/656/files#diff-5efc779a7e3c73ebd812eb62ff5dce68db1e0ed9ef9765bb076638733e8c5ae6
View file https://github.com/DataDog/datadog-lambda-python/blob/19fcf5f75d8de4b98d59b2f4afe6221f13a8a27d/datadog_lambda/wrapper.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/DataDog/datadog-lambda-python/pull/656/{{ revealButtonHref }}
https://github.com/DataDog/datadog-lambda-python/pull/656/files#diff-5efc779a7e3c73ebd812eb62ff5dce68db1e0ed9ef9765bb076638733e8c5ae6
joeyzhao2018https://github.com/joeyzhao2018
Sep 8, 2025https://github.com/DataDog/datadog-lambda-python/pull/656/files#r2331152318
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/DataDog/datadog-lambda-python/pull/656/files
florentinlhttps://github.com/florentinl
Sep 9, 2025https://github.com/DataDog/datadog-lambda-python/pull/656/files#r2332478940
Please reload this pagehttps://github.com/DataDog/datadog-lambda-python/pull/656/files
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/DataDog/datadog-lambda-python/pull/656/files
https://github.com/DataDog/datadog-lambda-python/pull/656/files#diff-5efc779a7e3c73ebd812eb62ff5dce68db1e0ed9ef9765bb076638733e8c5ae6
https://github.com/DataDog/datadog-lambda-python/pull/656/files#diff-5efc779a7e3c73ebd812eb62ff5dce68db1e0ed9ef9765bb076638733e8c5ae6
https://github.com/DataDog/datadog-lambda-python/blob/main/.github/CODEOWNERS#L1
tests/test_wrapper.pyhttps://github.com/DataDog/datadog-lambda-python/pull/656/files#diff-04c66d7f4e31da0ce6071254060c6f5f2fb97c7b05883fc354f02d3472cb4f01
View file https://github.com/DataDog/datadog-lambda-python/blob/19fcf5f75d8de4b98d59b2f4afe6221f13a8a27d/tests/test_wrapper.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/DataDog/datadog-lambda-python/pull/656/{{ revealButtonHref }}
https://github.com/DataDog/datadog-lambda-python/pull/656/files#diff-04c66d7f4e31da0ce6071254060c6f5f2fb97c7b05883fc354f02d3472cb4f01
https://github.com/DataDog/datadog-lambda-python/pull/656/files#diff-04c66d7f4e31da0ce6071254060c6f5f2fb97c7b05883fc354f02d3472cb4f01
https://github.com/DataDog/datadog-lambda-python/pull/656/files#diff-04c66d7f4e31da0ce6071254060c6f5f2fb97c7b05883fc354f02d3472cb4f01
https://github.com/DataDog/datadog-lambda-python/pull/656/files#diff-04c66d7f4e31da0ce6071254060c6f5f2fb97c7b05883fc354f02d3472cb4f01
https://github.com/DataDog/datadog-lambda-python/pull/656/files#diff-04c66d7f4e31da0ce6071254060c6f5f2fb97c7b05883fc354f02d3472cb4f01
Please reload this pagehttps://github.com/DataDog/datadog-lambda-python/pull/656/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.