aws-amplify / aws-amplify/amplify-hosting

Adding a space at the end of a redirect source address makes the rule fail

Open
#2,129 1 comment 0 reactions 0 assignees View on GitHub
redirects usability
Dominant language
Dockerfile
Stars
481
Forks
123
PR merge metrics
No merged PRs in 30d

Description

### Before opening, please confirm:

- [X] I have checked to see if my question is addressed in the [FAQ](https://github.com/aws-amplify/amplify-console/blob/master/FAQ.md).
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-console/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-console/blob/master/CONTRIBUTING.md).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

### App Id

_No response_

### Region

ca-central-1

### Amplify Console feature

Redirects

### Describe the bug

In the Amplify console Rewrites & redirects section, rules are not trimmed when entered. In particular, if a space is inadvertently added add the end of a source address, then that rewrite rule will fail. This was observed on the recommended SPA rewrite rule ` ` (notice the space at the end).

### Expected behavior

The redirect rule should forward normal URLS like `/about`, `/settings`, etc. to the desired source address. This does not occur if there is a space character at the end of the source address.

### Reproduction steps

1. Add a rewrite rule **with a space character** at the end (I have only tested this with the recommended SPA redirect source address).
2. Test it!

### Build Settings

_No response_

### Additional information

_No response_

Contributor guide

Open the contributing guide

Research direction

The issue names the Amplify Console Rewrites & redirects feature but no repository file, test, or entry point. Start by locating the rule-input handling and its redirect tests, then reproduce the trailing-space case with the recommended SPA rule. Done means a trailing space no longer causes the redirect rule to fail, with coverage for the reported input.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.