scimitar 2.4.1 → 2.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7db2b533d9bc2fe1e359a12ad51fea89bdd5498589451b16b99987ca0cd99f09
4
- data.tar.gz: 7b30102df8ee36d8bac2698ef150a3537c7b40f6193a64e3baed7e8d6c8386d4
3
+ metadata.gz: 610a1d6294e74d1a4540bd30e7cc01d85b25f184891ec8acad01368feb67fb6e
4
+ data.tar.gz: 382185bb81b19a3c2cc31aafbaa144d18877f3fc1f93676456c656499fea79ee
5
5
  SHA512:
6
- metadata.gz: 238c6bdebc57c0d8c186ad77d8222a79c7f9fad98b86a1d564c2c27d62a58dd809c1a4b2a7a9c57af535728f6a23d36821c12e74be81e8191d96960cdd1d1db9
7
- data.tar.gz: 684c778f5e3d03719b3df872ca8efcb29a18cd802360964282e38ed914b095676aeec4556a625c99f2a3de86f898cae1dd989be67614711194fd176a1c5895c1
6
+ metadata.gz: 50bdeb5492bcc461f2fb550b3ce7d8f3e03c8e3d9b0ca66691702f47e91f3e3868745351a37b953d1416d1225be635f8bc01a61de3e8e017c86c9e471b219dee
7
+ data.tar.gz: 2afddc9337f6810f8eaf6e932c14098ed56c473895716e7a21d5ae4eafc04831ecb8c6997cd128ab99a633a5f39debaa34fd3e3d59f629d4dc972737a7c3e95d
@@ -98,10 +98,10 @@ module Scimitar
98
98
  def require_scim
99
99
  scim_mime_type = Mime::Type.lookup_by_extension(:scim).to_s
100
100
 
101
- if request.content_type.nil?
101
+ if request.media_type.nil?
102
102
  request.format = :scim
103
103
  request.headers['CONTENT_TYPE'] = scim_mime_type
104
- elsif request.content_type&.downcase == scim_mime_type
104
+ elsif request.media_type.downcase == scim_mime_type
105
105
  request.format = :scim
106
106
  elsif request.format == :scim
107
107
  request.headers['CONTENT_TYPE'] = scim_mime_type
@@ -3,11 +3,11 @@ module Scimitar
3
3
  # Gem version. If this changes, be sure to re-run "bundle install" or
4
4
  # "bundle update".
5
5
  #
6
- VERSION = '2.4.1'
6
+ VERSION = '2.4.2'
7
7
 
8
8
  # Date for VERSION. If this changes, be sure to re-run "bundle install"
9
9
  # or "bundle update".
10
10
  #
11
- DATE = '2023-03-02'
11
+ DATE = '2023-03-21'
12
12
 
13
13
  end
@@ -38,6 +38,16 @@ RSpec.describe Scimitar::ApplicationController do
38
38
  expect(parsed_body['request']['content_type']).to eql('application/scim+json')
39
39
  end
40
40
 
41
+ it 'translates Content-Type with charset to Rails request format' do
42
+ get '/CustomRequestVerifiers', headers: { 'CONTENT_TYPE' => 'application/scim+json; charset=utf-8' }
43
+
44
+ expect(response).to have_http_status(:ok)
45
+ parsed_body = JSON.parse(response.body)
46
+ expect(parsed_body['request']['is_scim' ]).to eql(true)
47
+ expect(parsed_body['request']['format' ]).to eql('application/scim+json')
48
+ expect(parsed_body['request']['content_type']).to eql('application/scim+json; charset=utf-8')
49
+ end
50
+
41
51
  it 'translates Rails request format to header' do
42
52
  get '/CustomRequestVerifiers', params: { format: :scim }
43
53
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scimitar
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.1
4
+ version: 2.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - RIPA Global
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-03-02 00:00:00.000000000 Z
12
+ date: 2023-03-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails