Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

construct full url to pass to MockRequest#env_for #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

challengee
Copy link

I came accross issue #5 while testing reel with rack urlmap. It's not working because SERVER_NAME and SERVER_PORT do not get set correctly (see https://github.com/rack/rack/blob/master/lib/rack/mock.rb#L88).

I modified this so that a more complete url is passed to env_for. I don't know if it's the right way to go.

  • I'm still missing the scheme (just picking http for now)
  • Maybe Reel::Request#url should return a full url?

What do you think?

@tarcieri
Copy link
Member

tarcieri commented May 7, 2014

It's probably fine you're not handling the scheme, as reel-rack presently doesn't provide HTTPS support. It should! But that doesn't block this patch.

What happens if request.headers['Host'] is empty?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants