- Fix Buffer hashing bug: properly handle Buffer values in hashValue()
- Add CA array support: new hashCaValue() handles string[] | Buffer[]
- Fix timeline race condition: capture timeline reference in closure
at createConnection start to isolate concurrent requests
- Fix SSL verify message: check socket.authorized for accurate status
- Fix HTTP/HTTPS agent logic: only set httpsAgent for HTTPS requests
- Add tests for concurrent requests timeline isolation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use { keepAlive: true } instead of tlsOptions for HTTP agents
- Fix brace style consistency
- Add missing newline at EOF
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use { keepAlive: true } instead of tlsOptions for HTTP agents
- Add warning log for system proxy configuration errors
- Fix brace style consistency
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Export getOrCreateHttpAgent and use it in http-https-agents for
HTTP requests to enable connection pooling.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add getOrCreateAgentInternal helper to reduce code duplication
between getOrCreateAgent and getOrCreateHttpAgent functions.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add createTimelineHttpAgentClass for logging HTTP connection events
including proxy usage, DNS lookups, and connection establishment.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: enable SSL session caching for faster consecutive requests
Previously, Bruno created a new HTTPS agent for every request, which meant
SSL/TLS sessions couldn't be reused. This caused the full TLS handshake
(~450ms) to run on every request, even to the same endpoint.
Changes:
- Add agent caching based on TLS configuration (certs, proxy, SSL options)
- Reuse cached agents for requests with matching configuration
- SSL sessions are now cached and reused, significantly reducing
response time for consecutive requests to the same host
The fix maintains backward compatibility:
- Timeline logging moved to setup phase (before agent creation)
- Proxy and SSL validation behavior unchanged
- Added clearAgentCache() for testing and configuration changes
Fixes#5574
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address review feedback for SSL session caching
- Add passphrase to cache key to prevent incorrect agent reuse
- Add MAX_AGENT_CACHE_SIZE (100) with LRU-style eviction
- Use consistent node: prefix for crypto import
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: lohit <lohit@usebruno.com>
* refactor: comment out unused API hints in autocomplete.js
* refactor: comment out unused API translations in postman and bruno translators
Temporarily disable certain API translations due to UI update issues affecting their functionality. A note has been added to restore these translations once the UI fixes are implemented.
* refactor: temporarily skip tests for collection variable translations due to UI update issues
Commented out tests related to `setCollectionVar`, `deleteCollectionVar`, and related functionalities until the necessary UI updates are implemented. A note has been added to restore these tests once the fixes are live.
* refactor: comment out variable deletion and retrieval methods due to UI sync issues
* revert: ping.bru
* refactor: update postman translation tests to enable previously skipped cases
* feat: enhance API spec export with environment variables support
- Updated `exportApiSpec` function to accept and process environment variables for multi-server exports.
- Added logic to convert environment variables into a structured format for OpenAPI server entries.
- Enhanced the `CreateApiSpec` component to include environments in the exported YAML content.
- Introduced unit tests to validate the handling of server variables and their integration into the exported API specifications.
* refactor: streamline API spec export logic and improve variable handling
- Simplified variable extraction in `exportApiSpec` by directly assigning capture groups.
- Updated URL interpolation to use request variables instead of global variables for better accuracy.
- Enhanced handling of request body types by replacing early returns with breaks for clearer flow control.
- Adjusted tests to ensure backward compatibility with OpenAPI specifications and server variable handling.
* refactor: improve variable handling and URL processing in OpenAPI exporters
- Streamlined server variable assignment in `exportApiSpec` to handle undefined values more gracefully.
- Enhanced URL path extraction to ensure leading slashes are preserved in `getDefaultUrl` and `extractServerVars`.
- Updated string replacement logic to use `replaceAll` for consistent variable substitution in URLs.
* feat(sidebar): show "Add request" cta when collection or folder is empty
* fix: add connector lines and keyboard accessibility to empty-state CTA
* fix: debounce empty collection state to prevent flicker
Add 300ms delay before showing "Add request" button for empty collections.
This fixes a race condition where isLoading becomes false before the
items batch arrives from IPC, causing a brief flicker of the empty state.
Made-with: Cursor
---------
Co-authored-by: naman-bruno <naman@usebruno.com>
getCachedSystemProxy now awaits the initialization promise, preventing a race
condition where API calls made early in startup would bypass the system proxy.
* feat: add tokenType support for OAuth2
* refactor: rename tokenType to source in OpenCollection OAuth2 mapping
* refactor: rename tokenType to source in OAuth2 configuration
* chore: bump @opencollection/types to ~0.8.0
* fix: correct OAuth2 token type label in token viewer
* refactor: replace Dropdown with MenuDropdown in OAuth2 components
Migrate all 12 dropdown instances across 5 OAuth2 auth components to use
the MenuDropdown component, removing manual tippy ref management and
forwardRef icon patterns in favor of a declarative items-based API.
* fix(oauth2): prevent false callback matches on root path URLs and handle errors first
Move error check before callback URL matching in onWindowRedirect so
OAuth error responses are rejected immediately. Remove redundant error
param check from matchesCallbackUrl and require a code param or hash
fragment to match, preventing false positives on intermediate pages
when the callback URL is a root path like https://hostname/.
* fix(oauth2): clarify error handling comment
Remove "on the callback URL" from comment since error checking
now happens before callback URL matching.
* fix: multipart form-data file param export/import for Postman
* fix: Postman import compatibility for multipart form-data file params
This commit fixes two issues that caused Postman to fail importing
Bruno-exported collections with multipart form-data file parameters:
1. Changed `src` field format to match Postman's export format:
- Single file: export as string (e.g., "/path/to/file")
- Multiple files: export as array (e.g., ["/path/a", "/path/b"])
- Empty/null: export as null
Previously, Bruno always exported `src` as an array, but Postman's
importer expects a string for single files and fails to recognize
the file type and path when given an array.
2. Added `protocolProfileBehavior.disableBodyPruning` for GET/HEAD/OPTIONS
requests that have a body:
By default, Postman discards request bodies for HTTP methods that
typically don't have bodies (GET, HEAD, OPTIONS). Without this flag,
importing a GET request with a form-data body would result in the
body being silently dropped, making Postman unable to identify that
the request has a formdata body at all.
Both changes align Bruno's Postman export format with Postman's own
export format, ensuring full import compatibility.
---------
Co-authored-by: Chirag Chandrashekhar <cchirag85@gmail.com>
* feat(snippet-generator): implement encodeUrl setting to control URL encoding in generated snippets
* refactor(snippet-generator): rename and enhance URL encoding logic for better clarity and functionality
* feat(snippet-generator): enhance raw URL handling to preserve user encoding choices and improve snippet generation
* test(snippet-generator): add tests for URL fragment handling based on encodeUrl setting
* test(snippet-generator): improve comments on URL fragment handling to clarify RFC compliance
* feat(url): enhance interpolateUrlPathParams to support raw URL handling, preserving user encoding choices for snippet generation
* fix(url): ensure URLs are prefixed with http:// if missing in interpolateUrlPathParams function
* refactor(snippet-generator): streamline URL handling logic to improve snippet generation and ensure proper encoding based on settings
* feat(url): add stripOrigin utility to simplify URL processing in snippet generation
* test(snippet-generator): add test for double-encoding of pre-encoded URLs when encodeUrl is true
* feat(encoding): implement URL encoding settings and add tests for encoding behavior
* fix: address PR review comments (#7187)
- Remove unnecessary no-op jest.mock for @usebruno/common/utils
- Add length guard to prevent catastrophic replaceAll('/') on root-path URLs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* empty commit
* fix(tests): update interpolateUrlPathParams tests to use correct parameter structure
* empty commit
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add ensureActiveTabInCurrentWorkspace action and improve tab management
* refactor: enhance tab focus logic for current workspace and improve tab management
* tests: implement test for getTabToFocusForCurrentWorkspace logic and added a playwright
* refactor: improve comments for tab management logic and enhance workspace tab focus handling in tests
* refactor: ensure active tab in current workspace after collection removal and enhance tests for tab focus logic
* trigger build
* fix: tags schema updatd to array of string
* tests: added test cases for sanitizing tags, openapi-tags
* fix: enhance tag sanitization to support object input and UTF characters
---------
Co-authored-by: shubh-bruno <shubh-bruno@shubh-bruno.local>
* allow international characters in tag regex for UI and schema
validation
* update validation messages to match this
Co-authored-by: Miro Metsänheimo <miro.metsanheimo@cgi.com>
Prevent app crashes when loading GraphQL schemas with validation errors
(e.g., object types with no fields). The fix:
- Validates schemas using validateSchema() and shows warnings for issues
- Still loads the schema so autocomplete continues to work
- Wraps the CodeMirror GraphQL linter with error handling to catch
any validation errors during linting
Fixes#4529
Co-authored-by: Chirag Chandrashekhar <cchirag85@gmail.com>
* feat(): support multipart mixed
fix: support vars interpolation on mixed multi-part
Update packages/bruno-electron/src/ipc/network/interpolate-vars.js
Co-authored-by: Timon <39559178+Its-treason@users.noreply.github.com>
refactor: use startsWith
feat: best effort for other multipart/* contentypes
* feat: enhance variable interpolation for multipart requests
- Updated `interpolateVars` function to support interpolation in multipart/form-data and multipart/mixed requests.
- Added handling for empty multipart arrays and parts with missing or undefined values.
- Improved type checks for content types to ensure proper interpolation behavior.
Includes new tests to validate the interpolation functionality for multipart requests.
* fix: normalize error handling in sendRequest and improve test reliability
---------
Co-authored-by: Alfonso Presa <alfonso-presa@users.noreply.github.com>
* fix: storing status in example for yml file
* fix: temporary check for tests
* fix: temporary check for tests
* fix: temporary check for tests
* fix: temporary check for tests
* fix: temporary check for tests
* fix: temporary check for tests
* fix: temporary check for tests
* fix: temporary check for tests
* fix: temporary check for tests
* fix: temporary check for tests
* fix: temporary check for tests
* fix: temporary check for tests
* fix: test cases for status and statusText
* chore: removed logs
* fix: test cases for response status and text
* fix: test cases for response status and text
* fix: resolved comments
* fix: openapi test import test cases
* chore: removed console logs
* fix: status type in response example while import/export of collection
* fix: postman to bruno import
---------
Co-authored-by: shubh-bruno <shubh-bruno@shubh-bruno.local>