Skip to content

Commit

Permalink
Merge pull request #1144 from alphagov/main-merged-into-port-to-postg…
Browse files Browse the repository at this point in the history
…resql

Bring in latest changes from main
  • Loading branch information
aldavidson authored Aug 30, 2023
2 parents f0301a4 + 94aaced commit 6498f48
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 70 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ spec
test
tmp
vendor
db/mongo-dumps
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source "https://rubygems.org"

gem "rails", "7.0.7"
gem "rails", "7.0.7.2"

gem "bootsnap", require: false
gem "deepsort"
Expand Down
136 changes: 68 additions & 68 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,72 +1,72 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (7.0.7)
actionpack (= 7.0.7)
activesupport (= 7.0.7)
actioncable (7.0.7.2)
actionpack (= 7.0.7.2)
activesupport (= 7.0.7.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.7)
actionpack (= 7.0.7)
activejob (= 7.0.7)
activerecord (= 7.0.7)
activestorage (= 7.0.7)
activesupport (= 7.0.7)
actionmailbox (7.0.7.2)
actionpack (= 7.0.7.2)
activejob (= 7.0.7.2)
activerecord (= 7.0.7.2)
activestorage (= 7.0.7.2)
activesupport (= 7.0.7.2)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.7)
actionpack (= 7.0.7)
actionview (= 7.0.7)
activejob (= 7.0.7)
activesupport (= 7.0.7)
actionmailer (7.0.7.2)
actionpack (= 7.0.7.2)
actionview (= 7.0.7.2)
activejob (= 7.0.7.2)
activesupport (= 7.0.7.2)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.7)
actionview (= 7.0.7)
activesupport (= 7.0.7)
actionpack (7.0.7.2)
actionview (= 7.0.7.2)
activesupport (= 7.0.7.2)
rack (~> 2.0, >= 2.2.4)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.7)
actionpack (= 7.0.7)
activerecord (= 7.0.7)
activestorage (= 7.0.7)
activesupport (= 7.0.7)
actiontext (7.0.7.2)
actionpack (= 7.0.7.2)
activerecord (= 7.0.7.2)
activestorage (= 7.0.7.2)
activesupport (= 7.0.7.2)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.7)
activesupport (= 7.0.7)
actionview (7.0.7.2)
activesupport (= 7.0.7.2)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.7)
activesupport (= 7.0.7)
activejob (7.0.7.2)
activesupport (= 7.0.7.2)
globalid (>= 0.3.6)
activemodel (7.0.7)
activesupport (= 7.0.7)
activerecord (7.0.7)
activemodel (= 7.0.7)
activesupport (= 7.0.7)
activestorage (7.0.7)
actionpack (= 7.0.7)
activejob (= 7.0.7)
activerecord (= 7.0.7)
activesupport (= 7.0.7)
activemodel (7.0.7.2)
activesupport (= 7.0.7.2)
activerecord (7.0.7.2)
activemodel (= 7.0.7.2)
activesupport (= 7.0.7.2)
activestorage (7.0.7.2)
actionpack (= 7.0.7.2)
activejob (= 7.0.7.2)
activerecord (= 7.0.7.2)
activesupport (= 7.0.7.2)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.7)
activesupport (7.0.7.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.4)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
awesome_print (1.9.2)
Expand Down Expand Up @@ -125,7 +125,7 @@ GEM
null_logger
plek (>= 1.9.0)
rest-client (~> 2.0)
gds-sso (18.0.0)
gds-sso (18.1.0)
oauth2 (~> 2.0)
omniauth (~> 2.1)
omniauth-oauth2 (~> 1.8)
Expand Down Expand Up @@ -193,9 +193,9 @@ GEM
mime-types (3.4.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2023.0218.1)
mini_mime (1.1.2)
mini_portile2 (2.8.2)
minitest (5.18.0)
mini_mime (1.1.5)
mini_portile2 (2.8.4)
minitest (5.19.0)
msgpack (1.6.0)
multi_xml (0.6.0)
net-imap (0.3.7)
Expand All @@ -209,14 +209,14 @@ GEM
net-protocol
netrc (0.11.0)
nio4r (2.5.9)
nokogiri (1.15.3)
nokogiri (1.15.4)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.15.3-aarch64-linux)
nokogiri (1.15.4-aarch64-linux)
racc (~> 1.4)
nokogiri (1.15.3-arm64-darwin)
nokogiri (1.15.4-arm64-darwin)
racc (~> 1.4)
nokogiri (1.15.3-x86_64-linux)
nokogiri (1.15.4-x86_64-linux)
racc (~> 1.4)
null_logger (0.0.1)
oauth2 (2.0.9)
Expand Down Expand Up @@ -462,42 +462,42 @@ GEM
byebug (~> 11.0)
pry (>= 0.13, < 0.15)
public_suffix (5.0.3)
puma (6.3.0)
puma (6.3.1)
nio4r (~> 2.0)
racc (1.7.1)
rack (2.2.8)
rack-cache (1.14.0)
rack (>= 0.4)
rack-protection (3.0.6)
rack
rack-protection (3.1.0)
rack (~> 2.2, >= 2.2.4)
rack-proxy (0.7.6)
rack
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.7)
actioncable (= 7.0.7)
actionmailbox (= 7.0.7)
actionmailer (= 7.0.7)
actionpack (= 7.0.7)
actiontext (= 7.0.7)
actionview (= 7.0.7)
activejob (= 7.0.7)
activemodel (= 7.0.7)
activerecord (= 7.0.7)
activestorage (= 7.0.7)
activesupport (= 7.0.7)
rails (7.0.7.2)
actioncable (= 7.0.7.2)
actionmailbox (= 7.0.7.2)
actionmailer (= 7.0.7.2)
actionpack (= 7.0.7.2)
actiontext (= 7.0.7.2)
actionview (= 7.0.7.2)
activejob (= 7.0.7.2)
activemodel (= 7.0.7.2)
activerecord (= 7.0.7.2)
activestorage (= 7.0.7.2)
activesupport (= 7.0.7.2)
bundler (>= 1.15.0)
railties (= 7.0.7)
railties (= 7.0.7.2)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.0.7)
actionpack (= 7.0.7)
activesupport (= 7.0.7)
railties (7.0.7.2)
actionpack (= 7.0.7.2)
activesupport (= 7.0.7.2)
method_source
rake (>= 12.2)
thor (~> 1.0)
Expand Down Expand Up @@ -598,7 +598,7 @@ GEM
term-ansicolor (1.7.1)
tins (~> 1.0)
thor (1.2.2)
timecop (0.9.6)
timecop (0.9.8)
timeout (0.4.0)
tins (1.31.1)
sync
Expand All @@ -614,7 +614,7 @@ GEM
rack (>= 2.0.9)
warden-oauth2 (0.0.1)
warden
webmock (3.18.1)
webmock (3.19.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
Expand Down Expand Up @@ -652,7 +652,7 @@ DEPENDENCIES
plek
pry-byebug
rack-cache
rails (= 7.0.7)
rails (= 7.0.7.2)
rspec-rails
rubocop-govuk
simplecov
Expand Down
6 changes: 5 additions & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,24 @@ def config
def parse_json_request
# FIXME: base_path in the request body is deprecated and will be considered
# an error once all clients have been updated.
@request_data = JSON.parse(request.body.read).except("base_path")
body = request.body.read
@request_data = JSON.parse(body).except("base_path")
rescue JSON::ParserError
Rails.logger.warn "error parsing JSON from request body '#{body}'"
head :bad_request
end

def encoded_request_path
Addressable::URI.encode(request_path)
rescue Addressable::URI::InvalidURIError
Rails.logger.warn "Can't encode request_path '#{request_path}'"
raise InvalidRequest
end

def encoded_base_path
Addressable::URI.encode(base_path)
rescue Addressable::URI::InvalidURIError
Rails.logger.warn "Can't encode base_path '#{request_path}'"
raise InvalidRequest
end

Expand Down

0 comments on commit 6498f48

Please sign in to comment.