PerlDancer / PerlDancer/Dancer2

Should `uri_for` avoid prepending the base URI to absolute URIs?

Open
#932 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Question
Dominant language
Perl
Stars
604
Forks
288
Avg merge
1d 5h
Merged PRs (30d)
5

Description

Currently if you do something weird like

$request->uri_for('http://example.com')

it just tries to rebase the argument anyway:

http://localhost:5000/mountpoint/http://example.com

I'd argue that this is never what the user wants, so the method should either throw an exception or not rebase the argument (returning "http://example.com" unchanged).

For selfish reasons I prefer the second option. Possibly both options should be provided by different methods.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the uri_for implementation and reproduce the absolute-URI example to confirm the current rebasing behavior. Resolve whether the project should return absolute URIs unchanged or raise an exception, then add regression coverage and verify the chosen behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
backend
Issue type
Feature
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.