apache / apache/grails-core

Redirect works wrong for uri without protocol

Open
#10,497 6 comments 0 reactions 0 assignees View on GitHub
type: improvement type: minor
Dominant language
Groovy
Stars
2.9k
Forks
975
Avg merge
1d 22h
Merged PRs (30d)
92

Description

### Task List

- [X] Steps to reproduce provided
- [ ] Example that reproduces the problem uploaded to Github
- [X] Full description of the issue provided (see below)

### Steps to Reproduce

1. redirect(uri: "//google.com") or redirect(url: "//google.com")

### Expected Behaviour

redirect to current-app-protocol://google.com or //google.com

### Actual Behaviour

current-app-address//google.com . For example http://my-app.com//google.com

### Environment Information

- **Grails Version:** 3.1.15

Contributor guide

Open the contributing guide

Research direction

Start by reproducing redirect(uri: "//google.com") and redirect(url: "//google.com") in Grails 3.1.15, then trace the redirect handling entry point. Done means protocol-relative URIs redirect using the current application protocol or remain protocol-relative, with the reported current-app-address//google.com behavior covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
backend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.