mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#5195
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/5407
Author: @Manohar-ford
Created: 9/26/2025
Status: ❌ Closed
Base:
main← Head:Follow-Redirects📝 Commits (6)
92236b7feat: add followRedirects option to requests and update related handling3e5b482fix: update theme color from indigo to purple3fb2d5cfeat: add FOLLOW_REDIRECTS option to configuration8c622c5Update packages/hoppscotch-common/src/newstore/settings.ts3eed39dUpdate packages/hoppscotch-selfhost-desktop/src/platform/interceptors/native/index.ts2f86094feat: enhance request handling with follow_redirects support📊 Changes
29 files changed (+330 additions, -210 deletions)
View changed files
📝
packages/hoppscotch-common/locales/en.json(+1 -0)📝
packages/hoppscotch-common/src/helpers/functional/process-request.ts(+8 -1)📝
packages/hoppscotch-common/src/helpers/graphql/connection.ts(+4 -0)📝
packages/hoppscotch-common/src/helpers/kernel/gql/request.ts(+4 -0)📝
packages/hoppscotch-common/src/helpers/kernel/rest/request.ts(+6 -2)📝
packages/hoppscotch-common/src/kernel/relay.ts(+8 -1)📝
packages/hoppscotch-common/src/newstore/settings.ts(+2 -0)📝
packages/hoppscotch-common/src/pages/settings.vue(+9 -0)📝
packages/hoppscotch-common/src/platform/std/interceptors/proxy.ts(+2 -1)📝
packages/hoppscotch-common/src/platform/std/kernel-interceptors/browser/index.ts(+1 -1)📝
packages/hoppscotch-common/src/platform/std/kernel-interceptors/extension/index.ts(+11 -8)📝
packages/hoppscotch-common/src/platform/std/kernel-interceptors/native/store.ts(+4 -1)📝
packages/hoppscotch-common/src/platform/std/kernel-interceptors/proxy/index.ts(+6 -3)📝
packages/hoppscotch-common/src/services/kernel-interceptor.service.ts(+2 -1)📝
packages/hoppscotch-common/src/services/persistence/validation-schemas/index.ts(+1 -0)📝
packages/hoppscotch-desktop/plugin-workspace/relay/src/interop.rs(+1 -0)📝
packages/hoppscotch-desktop/plugin-workspace/relay/src/request.rs(+25 -46)📝
packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-relay/Cargo.toml(+1 -1)📝
packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-relay/dist-js/index.d.ts(+2 -1)📝
packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-relay/dist-js/index.d.ts.map(+1 -1)...and 9 more files
📄 Description
Closes #2095
This Pull Request introduces a new, user-configurable option to control how Hoppscotch handles HTTP redirects (e.g., 301, 302, 307, 308). It provides the ability to either automatically follow redirects or explicitly disable this behavior, directly addressing the limitations and user requests outlined in Issue #2095. This change offers greater control and visibility into HTTP request flows, especially for debugging and inspecting intermediate responses.
What's changed
This PR implements a globally configurable and per-request controllable "Follow Redirects" capability across all Hoppscotch clients (web, desktop, self-hosted, kernel relay).
FOLLOW_REDIRECTSSetting:FOLLOW_REDIRECTS(default:true) has been added to the settings store (packages/hoppscotch-common/src/newstore/settings.ts). This ensures backward compatibility, as existing users will inherit the default behavior.followRedirectsOption:followRedirectsboolean option is now propagated through REST, GraphQL, and Kernel relay requests. This option takes precedence over the global setting.followRedirectsflag is integrated into the Kernel relay request model (packages/hoppscotch-kernel/src/relay/v/1.ts) and is preserved across internal adapters and interceptor layers (web/proxy and native/desktop paths).FOLLOW_REDIRECTSis enabled, the redirect chain (an array of{ status, location, method?, url? }) is recorded and surfaced via the existingredirectsresponse field, contingent on backend capabilities.FOLLOW_REDIRECTSis disabled (either globally or per-request), Hoppscotch will now return the first 3xx response immediately to the UI. This allows users to inspect theLocationheader and other metadata without further redirect resolution.Notes to reviewers
Locationheaders for debugging authentication flows, security analysis, and understanding redirect chains, which was previously impossible due to implicit handling by underlying transport layers.followRedirectsistrue(final response, redirect chain present) andfalse(3xx response returned,Locationheader visible). Parity between desktop and web clients was confirmed.CRITICALmarkers) have been added to prevent accidental stripping ofrequest.optionsduring request cloning or transformation, ensuringfollowRedirectspersists through various pipeline stages.Locationheaders, and method rewriting on 301/302/303.maxRedirectsas a global setting, and updating documentation.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.