Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
heroku-buildpack-static
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Python-Dev
heroku-buildpack-static
Commits
5ebdbba7
Commit
5ebdbba7
authored
Jun 24, 2015
by
Terence Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix test for port_in_redirect off
parent
2941d9c7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
simple_spec.rb
spec/simple_spec.rb
+2
-2
app_runner.rb
spec/support/app_runner.rb
+6
-2
No files found.
spec/simple_spec.rb
View file @
5ebdbba7
...
@@ -65,10 +65,10 @@ RSpec.describe "Simple" do
...
@@ -65,10 +65,10 @@ RSpec.describe "Simple" do
describe
"redirects"
do
describe
"redirects"
do
let
(
:name
)
{
"redirects"
}
let
(
:name
)
{
"redirects"
}
it
"should redirect and respect the http code"
do
it
"should redirect and respect the http code
& remove the port
"
do
response
=
app
.
get
(
"/old/gone"
)
response
=
app
.
get
(
"/old/gone"
)
expect
(
response
.
code
).
to
eq
(
"302"
)
expect
(
response
.
code
).
to
eq
(
"302"
)
expect
(
response
[
"location"
]).
to
eq
(
"http://
#{
AppRunner
::
HOST_IP
}
:
#{
AppRunner
::
HOST_PORT
}
/"
)
expect
(
response
[
"location"
]).
to
eq
(
"http://
#{
AppRunner
::
HOST_IP
}
/"
)
end
end
end
end
...
...
spec/support/app_runner.rb
View file @
5ebdbba7
...
@@ -54,8 +54,12 @@ class AppRunner
...
@@ -54,8 +54,12 @@ class AppRunner
run
do
run
do
network_retry
(
max_retries
)
do
network_retry
(
max_retries
)
do
uri
=
URI
(
"http://
#{
HOST_IP
}
:
#{
HOST_PORT
}
/
#{
path
}
"
)
uri
=
URI
(
"
#{
path
}
"
)
response
=
Net
::
HTTP
.
get_response
(
uri
)
uri
.
host
=
HOST_IP
if
uri
.
host
.
nil?
uri
.
port
=
HOST_PORT
if
(
uri
.
host
==
HOST_IP
&&
uri
.
port
!=
HOST_PORT
)
||
uri
.
port
.
nil?
uri
.
scheme
=
"http"
if
uri
.
scheme
.
nil?
response
=
Net
::
HTTP
.
get_response
(
URI
(
uri
.
to_s
))
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment