Skip to content

Normalize connection URL whitespace#1982

Merged
kmcginnes merged 1 commit into
aws:mainfrom
bakar-dev:trim-connection-url-whitespace
Jul 23, 2026
Merged

Normalize connection URL whitespace#1982
kmcginnes merged 1 commit into
aws:mainfrom
bakar-dev:trim-connection-url-whitespace

Conversation

@bakar-dev

Copy link
Copy Markdown
Contributor

Description

  • Normalize the Public or Proxy Endpoint and Graph Connection URL fields when the connection form is submitted.
  • Remove carriage returns and newline characters, then trim surrounding whitespace before validation and storage.
  • Reject URL values that become empty after normalization.
  • Add regression tests covering both URL fields and whitespace-only input.

Validation

  • Ran pnpm checks successfully.
  • Ran the complete pnpm test suite successfully: 191 test files and all 2,220 tests passed.
  • Manually reproduced the issue and verified the fix by saving and reopening a connection.

Before

The saved URL retains surrounding whitespace and a newline:

Connection URL before normalization

After

The saved URL is normalized into a clean single line:

Connection URL after normalization

Related Issues

Check List

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I have verified pnpm checks passes with no errors.
  • I have verified pnpm test passes with no failures.
  • I have covered new added functionality with unit tests if necessary.
  • I have updated documentation if necessary.

@kmcginnes
kmcginnes self-requested a review July 23, 2026 20:27
@kmcginnes
kmcginnes marked this pull request as ready for review July 23, 2026 22:47

@kmcginnes kmcginnes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! I'm assuming based on your comments and description that you did not intend to leave this in draft. Merging, as this cleanly delivers the form-side of #1978 (strip newlines + trim on submit).

For context: this normalizes on submit, so it cleans a connection when the user re-saves it. The complementary read-path fix has already landed in main via #1998. That moves normalization into normalizeConnection, so connections already persisted with whitespace/newlines (including the graph-db-connection-url proxy header) are cleaned on read without needing a re-save.

The two compose: your form-layer fix gives immediate validation feedback, and the read-layer fix covers the installed base.

@kmcginnes
kmcginnes merged commit 8c19312 into aws:main Jul 23, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Connection form accepts spaces and newlines in URL fields

2 participants