Skip to content

Commit

Permalink
More proxy prefix settings to fix up.
Browse files Browse the repository at this point in the history
  • Loading branch information
bertrama committed Oct 27, 2023
1 parent 3a0b6ea commit c21bb85
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion config/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3972,7 +3972,7 @@
headings: [ 'Action', 'Description' ]
link_text: Go to item
openurl_root: https://mgetit.lib.umich.edu/resolve
proxy_prefix: https://proxy.lib.umich.edu/login?url=
proxy_prefix: https://proxy.lib.umich.edu/login?qurl=

- id: retracted
metadata:
Expand Down
2 changes: 1 addition & 1 deletion local-gems/spectrum-config/lib/spectrum/config/filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def add_prefix(prefix, value)
return value unless value
return value if value.include?('proxy.lib.umich.edu')
return value if value.include?('libproxy.umflint.edu')
prefix + value
prefix + URI::encode_www_form_component(value)
end

def <=>(other)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def value(data, request = nil)
extra_headings = []

url = if data.link_to_resource?
"#{proxy_prefix}#{data.link_to_resource}"
proxy_prefix + URI::encode_www_form_component(data.link_to_resource)
else
"#{openurl_root}?#{data.openurl}"
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def value(data, request = nil)
hsh['text'] = "#{field['name']}: #{count}"
if (href = [data.src[field['href']]].flatten.first)
hsh['href'] = if request.respond_to?(:proxy_prefix)
request.proxy_prefix + href
request.proxy_prefix + URI::encode_www_form_component(href)
else
href
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def value(data, request = nil)
hsh['text'] = "#{field['name']}: #{count}"
if (href = [data.src[field['href']]].flatten.first)
hsh['href'] = if request.respond_to?(:proxy_prefix)
request.proxy_prefix + href
request.proxy_prefix + URI::encode_www_form_component(href)
else
href
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def value(data, request = nil)
fields.map do |field|
if (count = [data.src[field['count']]].flatten.first)
if (href = [data.src[field['href']]].flatten.first)
href = request.proxy_prefix + href if request
href = request.proxy_prefix + URI::encode_www_form_component(href) if request
"#{encoder.encode(field['name'])}: <a href='#{encoder.encode(href)}'>#{encoder.encode(count)}</a>"
else
"#{encoder.encode(field['name'])}: #{encoder.encode(count)}"
Expand Down
4 changes: 2 additions & 2 deletions local-gems/spectrum-json/lib/spectrum/request/email.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ module Spectrum
module Request
class Email
FLINT = "Flint"
FLINT_PROXY_PREFIX = "http://libproxy.umflint.edu:2048/login?url="
DEFAULT_PROXY_PREFIX = "https://proxy.lib.umich.edu/login?url="
FLINT_PROXY_PREFIX = "http://libproxy.umflint.edu:2048/login?qurl="
DEFAULT_PROXY_PREFIX = "https://proxy.lib.umich.edu/login?qurl="
INSTITUTION_KEY = "dlpsInstitutionId"

def proxy_prefix
Expand Down
4 changes: 2 additions & 2 deletions local-gems/spectrum-json/lib/spectrum/request/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ module Spectrum
module Request
class File
FLINT = 'Flint'
FLINT_PROXY_PREFIX = 'http://libproxy.umflint.edu:2048/login?url='
DEFAULT_PROXY_PREFIX = 'https://proxy.lib.umich.edu/login?url='
FLINT_PROXY_PREFIX = 'http://libproxy.umflint.edu:2048/login?qurl='
DEFAULT_PROXY_PREFIX = 'https://proxy.lib.umich.edu/login?qurl='
INSTITUTION_KEY = 'dlpsInstitutionId'

def proxy_prefix
Expand Down
2 changes: 1 addition & 1 deletion local-gems/spectrum-json/lib/spectrum/request/null.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Spectrum
module Request
class Null
def proxy_prefix
'https://proxy.lib.umich.edu/login?url='
'https://proxy.lib.umich.edu/login?qurl='
end

def messages
Expand Down
4 changes: 2 additions & 2 deletions local-gems/spectrum-json/lib/spectrum/request/profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ module Spectrum
module Request
class Profile
FLINT = "Flint"
FLINT_PROXY = "https://login.libproxy.umflint.edu/login?url="
FLINT_PROXY = "https://login.libproxy.umflint.edu/login?qurl="
DEARBORN = "Dearborn"
DEARBORN_PROXY = "https://library.umd.umich.edu/verify/fwd.php?"
ANN_ARBOR_PROXY = "https://proxy.lib.umich.edu/login?url="
ANN_ARBOR_PROXY = "https://proxy.lib.umich.edu/login?qurl="
DEFAULT_DOMAIN = "@umich.edu"
LOGGED_IN = "Logged in"
NOT_LOGGED_IN = "Not logged in"
Expand Down
4 changes: 2 additions & 2 deletions local-gems/spectrum-json/lib/spectrum/request/record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ module Request
class Record

FLINT = 'Flint'
FLINT_PROXY_PREFIX = 'http://libproxy.umflint.edu:2048/login?url='
DEFAULT_PROXY_PREFIX = 'https://proxy.lib.umich.edu/login?url='
FLINT_PROXY_PREFIX = 'http://libproxy.umflint.edu:2048/login?qurl='
DEFAULT_PROXY_PREFIX = 'https://proxy.lib.umich.edu/login?qurl='
INSTITUTION_KEY = 'dlpsInstitutionId'

def proxy_prefix
Expand Down
4 changes: 2 additions & 2 deletions local-gems/spectrum-json/lib/spectrum/request/requesty.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ module Requesty
extend ActiveSupport::Concern

FLINT = 'Flint'
FLINT_PROXY_PREFIX = 'http://libproxy.umflint.edu:2048/login?url='
DEFAULT_PROXY_PREFIX = 'https://proxy.lib.umich.edu/login?url='
FLINT_PROXY_PREFIX = 'http://libproxy.umflint.edu:2048/login?qurl='
DEFAULT_PROXY_PREFIX = 'https://proxy.lib.umich.edu/login?qurl='
INSTITUTION_KEY = 'dlpsInstitutionId'

included do
Expand Down
4 changes: 2 additions & 2 deletions local-gems/spectrum-json/lib/spectrum/request/text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ module Spectrum
module Request
class Text
FLINT = "Flint"
FLINT_PROXY_PREFIX = "http://libproxy.umflint.edu:2048/login?url="
DEFAULT_PROXY_PREFIX = "https://proxy.lib.umich.edu/login?url="
FLINT_PROXY_PREFIX = "http://libproxy.umflint.edu:2048/login?qurl="
DEFAULT_PROXY_PREFIX = "https://proxy.lib.umich.edu/login?qurl="
INSTITUTION_KEY = "dlpsInstitutionId"

def proxy_prefix
Expand Down

0 comments on commit c21bb85

Please sign in to comment.