Skip to content

Commit

Permalink
Redirect gems.rubyforge.org
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisroos committed Oct 18, 2024
1 parent 3594fe9 commit ed85fb2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fastly.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,12 @@ if (table.contains(solution_redirects, req.url.path)) {
error 618 "redirect";
}

if (req.http.host ~ "^gems.") {
error 617 "https://rubygems.org";
}

if (req.http.host ~ "^mocha.") {
error 617 "https://github.com/freerange/mocha";
# set req.url = regsub(req.url, "/", "/subcontent/");
}

if (req.url.path ~ "^/projects/mocha/") {
Expand Down
6 changes: 6 additions & 0 deletions test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ def test_apex
assert_equal "http://www.#{DOMAIN}/", response['Location']
end

def test_gems
response = request "gems.#{DOMAIN}"
assert_equal '308', response.code
assert_equal "https://rubygems.org", response['Location']
end

def test_mocha_subdomain
response = request "mocha.#{DOMAIN}"
assert_equal '308', response.code
Expand Down

0 comments on commit ed85fb2

Please sign in to comment.