Commit graph

5648 commits

Author SHA1 Message Date
Nivedin
3cf286a443
fix(common): OpenAPI response example status code bug (#4966)
Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
2025-04-08 14:46:29 +05:30
Nivedin
a263113147
chore: add organization dashboard link to profile dropdown (#4952) 2025-04-07 19:56:29 +05:30
Shreyas
3803735d28
fix(web): add explicit headers following prior normalization (#4951)
These changes add explicit `Content-Type` headers to direct (via `native` interceptor)
authentication requests after changes made in [PR #4931](https://github.com/hoppscotch/hoppscotch/pull/4931) that modified how `Content-Type`
headers are handled in the `relay` plugin.

In [issue #4905](https://github.com/hoppscotch/hoppscotch/issues/4905), that was about Hoppscotch Agent and Native interceptor inconsistently
handling `Content-Type` headers. The issue had two main manifestations,
duplicate headers - when overriding the `Content-Type` header in the UI or using OAuth2 authentication, the agent
would send multiple `Content-Type` headers to the web server. This caused undefined behavior
and often 400 errors for backends that don't accept duplicate headers.
And inconsistent overrides - even when the content type was explicitly set (for example to
`application/json;v=2`), the agent/native would inconsistently apply this override. Server
logs revealed that roughly 50% of requests would use the correct override value, while the
others would revert to the default `application/json`.

The two-part solution implemented first in [PR #4911](https://github.com/hoppscotch/hoppscotch/pull/4911) addressed the duplicate headers issue
by implementing header normalization before final relay. This prevented duplicate headers
with different casing from being sent and [PR #4931](https://github.com/hoppscotch/hoppscotch/pull/4931) then resolved the inconsistent override
behavior by removing the automatic `Content-Type` header insertion in the `ContentHandler`
component. As explained in the PR description, this was a temporary workaround until we
implement a HTTP/2-compliant solution with proper normalization.

While the fixes in PR #4911 and #4931 correctly resolved the header inconsistency issues
for general API requests, they introduced a new problem: **requests that previously relied
on the automatic `Content-Type` insertion now have no `Content-Type` header at all**.

This mainly affects direct calls around authentication flows in the desktop module, which
were using the `content.json()` functionality without explicitly setting `Content-Type`
headers, relying on the automatic insertion that has now been removed.

These changes add the now-required explicit `Content-Type` headers to three
authentication-related API calls in the desktop platform module:

- **The initial user details GraphQL query**:
```javascript
headers: {
  Authorization: `Bearer ${accessToken}`,
  "Content-Type": "application/json",
},
```

- **The magic link email submission endpoint**:
```javascript
headers: {
  "Content-Type": "application/json",
},
```

- **The token verification endpoint**:
```javascript
headers: {
  "Content-Type": "application/json",
},
```

This will make sure that authentication flows continue to work properly with the native
interceptor after the header handling changes.

As noted in [PR #4931](https://github.com/hoppscotch/hoppscotch/pull/4931), this is considered a **temporary solution**. The plan is to revisit the
content-type handling when we implement a more comprehensive HTTP/2-compliant header
normalization system in the kernel layer.

While HTTP/1.1 headers are case-insensitive
per [RFC 7230](https://tools.ietf.org/html/rfc7230), inconsistent handling across server implementations can treat differently-cased
variations as distinct headers. HTTP/2 ([RFC 7540](https://tools.ietf.org/html/rfc7540)) mandates converting all header field
names to lowercase, which would prevent these issues altogether. In such cases, relying
fully on `MediaType` interface from the kernel will help handling these edge-cases.
2025-04-04 14:45:05 +05:30
Nivedin
fb2b677faf
fix: import bug with extension and agent interceptors (#4932)
Co-authored-by: curiouscorrelation <curiouscorrelation@gmail.com>
2025-03-28 17:52:45 +05:30
Christoffer Hjalmarsson
0c361faeab
fix(common): oauth2 basic header encoding (#4927) 2025-03-28 13:46:22 +05:30
Anwarul Islam
9e541a8a4b
feat: format JSON responses having text/plain content type (#4916)
Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
2025-03-28 13:38:32 +05:30
jamesgeorge007
4e29810f69 chore: i18n string entry updates 2025-03-27 23:23:09 +05:30
Andrew Bastin
ba64fea681
chore: bump vulnerable dependencies (#4943) 2025-03-27 22:45:29 +05:30
Nivedin
f564b2e34f
feat: Agent registration UX flow updates (#4942)
Co-authored-by: curiouscorrelation <curiouscorrelation@gmail.com>
Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
2025-03-27 21:09:23 +05:30
jamesgeorge007
3c535b2ad4 chore: bump version to 2025.3.0 2025-03-27 13:15:30 +05:30
Anwarul Islam
24fbe3e01a
feat(common): create new requests without siphoning data from the previous one (#4909)
Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
2025-03-27 12:49:42 +05:30
Anwarul Islam
bedb0ffdb6
fix(common): improve authorization header handling (#4818) 2025-03-26 17:12:41 +05:30
Christoffer Hjalmarsson
ba165bc505
fix(common): oauth2 password flow not respecting scopes (#4940) 2025-03-26 16:50:36 +05:30
Pranay Pandey
b9ea5f7916
feat: search requests by endpoint in personal workspace (#4779)
Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
2025-03-26 15:22:14 +05:30
Shreyas
d00c219401
fix(desktop): enable cookie support for sh-desktop (#4939) 2025-03-26 15:01:36 +05:30
Sbe-ng
e4ff043fd6
docs: link to the Desktop App (#4925) 2025-03-25 16:40:42 +05:30
Shreyas
72ff950d91
fix(relay): avoid override with header passthrough (#4931)
The current implementation causes duplicate `Content-Type` headers when users
override headers in the UI or use OAuth2 authentication with the agent.
Web servers receive multiple `Content-Type` headers which causes
undefined behavior and 400 errors for backends that don't accept duplicate headers.

This also fixes inconsistent behavior when overriding the `Content-Type` header
with custom values (e.g., `application/json;v=2`).

While HTTP/1.1 headers are case-insensitive per RFC 7230, inconsistent handling
across server implementations can treat differently-cased variations (e.g.,
"Content-Type" vs "content-type") as distinct headers. HTTP/2 (RFC 7540) mandates
converting all header field names to lowercase, which would prevent this issue.

This patch removes the automatic content-type header insertion, allowing user-defined
headers to take precedence without duplication. The is a temporary
workaround until we implement a HTTP/2-compliant solution with proper normalization.

This was implemented initially to support moving lower level handling
towards the kernel, although since the larger refactor has been slightly
deferred in favor of stability, this change is suitable for current
state.

This will be revisited when we implement HTTP/2 compliant header handling in the
kernel layer as part of our upcoming kernel efforts.

Use the following request to test this out on Desktop app and Agent and
override `Content-Type` header to `application/json;=v2`:

```
curl --request POST \
  --url 'https://echo.qubit.codes/?qp=1' \
  --header 'Content-Type: application/json;v=2' \
  --data '{ "test-key": "test-value" }'
```
2025-03-25 16:34:27 +05:30
SimonAllen
f5beabed1e
chore(i18n): update tw translation (#4920) 2025-03-25 16:32:25 +05:30
Nivedin
e43d0f1b70
feat: add search in environment selector and sidebar (#4872)
Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
2025-03-24 22:18:19 +05:30
Anwarul Islam
1a2b9516c9
feat(common): click to activate environment from sidebar as primary (#4873)
Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
2025-03-21 13:22:46 +05:30
jamesgeorge007
d8e297f61e chore: merge main into next 2025-03-19 16:52:23 +05:30
Shreyas
86c0bb619d
fix(infra): deterministic env var ordering (#4893)
This change sorts environment variables alphabetically before they're
processed with import-meta-env that injects them into the index.html.
This makes sure consistent hashes across pod restarts when there aren't
any functional changes made to the `.env` file.

The issue was affecting desktop app reconnections after k8s pod restarts.

The cause was non-deterministic env var ordering (a sideeffect of `Map`)
during the import-meta-env injection process. Even when the env vars
themselves didn't change, their order in the injected JSON could change,
ultimately resulting in different file hashes.

This fix ensures that regardless of the order in which env vars are
provided by the runtime, they will be sorted alphabetically before being
written to the build.env file.
2025-03-19 16:08:47 +05:30
Shreyas
18c233b9f9
fix(common): normalize headers before final relay (#4911) 2025-03-19 15:47:41 +05:30
Nivedin
346a1a3688
fix: resolve issues around import via URL (#4906) 2025-03-19 15:10:20 +05:30
jamesgeorge007
8c67c832d2 chore: bump version to 2025.2.3 2025-03-19 14:41:08 +05:30
Shreyas
51124e91b5
fix(desktop): fix missing ca certs when client certs are not present (#4888) 2025-03-19 14:37:55 +05:30
Shreyas
60cc41f745
fix(desktop): preserve formdata ordering (#4892) 2025-03-19 14:04:13 +05:30
Anwarul Islam
5f3a7754d5
fix(common): handle missing host and basePath in OpenAPI URL parsing (#4908)
Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
2025-03-19 13:50:03 +05:30
Shreyas
2b5395011a
fix(common): pre-process proxy response to base type (#4910) 2025-03-19 13:12:32 +05:30
Andrew Bastin
a64c72e8fb chore: updated docker release ci 2025-03-19 12:50:59 +05:30
Nivedin
e2e5d4f1d5
fix: resolve issues around rendering HTML response previews (#4890)
Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
2025-03-18 13:32:07 +05:30
jamesgeorge007
176e924bed fix: prevent dev server crashes due to breaking changes in the vue-i18n suite of tools
Migrate from `vite-plugin-vue-i18n` to `@intlify/unplugin-vue-i18n`.
2025-03-18 12:29:18 +05:30
Shreyas
03130a5317
fix(kernel): pre-req transformers for backcompat (#4883) 2025-03-17 14:28:49 +05:30
Nivedin
094ba7dfe4
chore: replace old interceptor component with new one (#4887)
Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
2025-03-14 20:50:05 +05:30
Chhavi Goyal
622b753c55
fix: preserve hierarchy during personal collection imports (#4815)
Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
2025-03-14 13:46:04 +05:30
Anwarul Islam
924a7c778e
feat: improve graphql query builder (#4742)
Co-authored-by: nivedin <nivedinp@gmail.com>
2025-03-13 17:02:14 +05:30
jamesgeorge007
84dc586582 chore: merge main into next 2025-03-13 16:34:58 +05:30
Shreyas
212cd4969d
docs(desktop): include windows specific caveats (#4884) 2025-03-13 16:25:25 +05:30
Anwarul Islam
f63474cd06
fix(common): correct coordinates calculation for selection end position (#4826) 2025-03-13 13:56:04 +05:30
Andrew Bastin
5b0125b412 chore: temporary skip for docker release ci 2025-03-13 01:44:52 +05:30
Andrew Bastin
795f7cf19b chore: add workflow_dispatch to the docker release ci 2025-03-12 23:39:12 +05:30
Andrew Bastin
cba478bd96 chore: revert matrix runner to single runner build 2025-03-12 23:35:14 +05:30
Andrew Bastin
a0f424799c chore: update ci to parallelize and cache docker builds 2025-03-12 16:06:17 +05:30
Nivedin
acd190f3e9
fix: update the newline key in codemirror (#4876)
Co-authored-by: Jai A P <jai.jap.318@gmail.com>
2025-03-12 15:51:23 +05:30
jamesgeorge007
6bd2574cba chore: bump agent version to 0.1.6 2025-03-12 14:08:06 +05:30
jamesgeorge007
05399d874a chore: bump version to 2025.2.2 2025-03-12 13:59:11 +05:30
Shreyas
a9d35b7f93
fix(infra): docker compose service dependencies (#4871) 2025-03-12 13:58:18 +05:30
luzpaz
a8bf6c0611
fix: resolve typos across packages (#4867) 2025-03-12 13:53:08 +05:30
jamesgeorge007
e6fee11305 fix: persist active workspace selection
This is observed particularly in the cloud offering. The proposed changes ensure the relevant login state is confirmed before the network call, maintaining backwards compatibility with SH.
2025-03-11 16:04:03 +05:30
jamesgeorge007
d3f0e8303a chore: merge main into patch 2025-03-10 22:47:15 +05:30