[PR #5212] chore: refactor the http executor node #24823

Closed
opened 2026-02-21 20:23:45 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/5212

State: closed
Merged: Yes


Description

Change List:

  1. remove the requests of ssrf_proxy. In the past, we use both httpx and requests because it support body of DELETE method. Now we can use httpx to achieve it too. more details here
  2. remove the OPTION method of backend, and make the GET / DELETE / HEAD also support http body. This maintains the consistency between the front-end and back-end. In the past , we implicit drop the body of GET.
  3. upgrade httpx from 0.24.1 to 0.27.0. the release note seems not to affect our usage scenarios. It support Python3.12 which maybe we will support later, and the proxies parameter will be deprecate later, use a singleproxy for all request maybe more commonly used.
  4. drop *args of ssrf_proxy request methods, cause httpx only support **kwargs.
  5. refactor the _to_dict method which convert params/headers/body from frontend to python dict, and add test for it.

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update, included: Dify Document
  • Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement
  • Dependency upgrade

How Has This Been Tested?

Integration test and local test.

  • TODO

Suggested Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
  • optional I have made corresponding changes to the documentation
  • optional I have added tests that prove my fix is effective or that my feature works
  • optional New and existing unit tests pass locally with my changes
**Original Pull Request:** https://github.com/langgenius/dify/pull/5212 **State:** closed **Merged:** Yes --- # Description Change List: 1. remove the `requests` of ssrf_proxy. In the past, we use both `httpx` and `requests` because it support body of DELETE method. Now we can use httpx to achieve it too. [more details here](https://www.python-httpx.org/compatibility/#request-body-on-http-methods) 2. remove the `OPTION` method of backend, and make the `GET` / `DELETE` / `HEAD` also support http body. This maintains the consistency between the front-end and back-end. In the past , we implicit drop the body of `GET`. 3. upgrade httpx from 0.24.1 to 0.27.0. the [release note](https://github.com/encode/httpx/releases) seems not to affect our usage scenarios. It support Python3.12 which maybe we will support later, and the `proxies` parameter will be deprecate later, use a single`proxy` for all request maybe more commonly used. 4. drop `*args` of ssrf_proxy request methods, cause httpx only support `**kwargs`. 5. refactor the `_to_dict` method which convert params/headers/body from frontend to python dict, and add test for it. ## Type of Change Please delete options that are not relevant. - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [x] Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement - [x] Dependency upgrade # How Has This Been Tested? Integration test and local test. - [ ] TODO # Suggested Checklist: - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] My changes generate no new warnings - [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods - [ ] `optional` I have made corresponding changes to the documentation - [ ] `optional` I have added tests that prove my fix is effective or that my feature works - [ ] `optional` New and existing unit tests pass locally with my changes
yindo added the pull-request label 2026-02-21 20:23:45 -05:00
yindo closed this issue 2026-02-21 20:23:45 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#24823