Skip to content

Commit 153a896

Browse files
committed
Fix searching on URL-encodable chars
1 parent f55cafa commit 153a896

File tree

5 files changed

+57
-53
lines changed

5 files changed

+57
-53
lines changed

Gemfile.lock

Lines changed: 49 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -77,23 +77,23 @@ GEM
7777
securerandom (>= 0.3)
7878
tzinfo (~> 2.0, >= 2.0.5)
7979
uri (>= 0.13.1)
80-
addressable (2.8.8)
80+
addressable (2.8.9)
8181
public_suffix (>= 2.0.2, < 8.0)
8282
ast (2.4.3)
8383
aws-eventstream (1.4.0)
84-
aws-partitions (1.1209.0)
85-
aws-sdk-core (3.241.4)
84+
aws-partitions (1.1220.0)
85+
aws-sdk-core (3.242.0)
8686
aws-eventstream (~> 1, >= 1.3.0)
8787
aws-partitions (~> 1, >= 1.992.0)
8888
aws-sigv4 (~> 1.9)
8989
base64
9090
bigdecimal
9191
jmespath (~> 1, >= 1.6.1)
9292
logger
93-
aws-sdk-kms (1.121.0)
93+
aws-sdk-kms (1.122.0)
9494
aws-sdk-core (~> 3, >= 3.241.4)
9595
aws-sigv4 (~> 1.5)
96-
aws-sdk-s3 (1.212.0)
96+
aws-sdk-s3 (1.213.0)
9797
aws-sdk-core (~> 3, >= 3.241.4)
9898
aws-sdk-kms (~> 1)
9999
aws-sigv4 (~> 1.5)
@@ -102,7 +102,7 @@ GEM
102102
base64 (0.3.0)
103103
bcrypt (3.1.21)
104104
bigdecimal (4.0.1)
105-
brakeman (7.1.2)
105+
brakeman (8.0.4)
106106
racc
107107
builder (3.3.0)
108108
bullet (8.1.0)
@@ -120,7 +120,7 @@ GEM
120120
capybara-email (3.0.2)
121121
capybara (>= 2.4, < 4.0)
122122
mail
123-
capybara-screenshot (1.0.26)
123+
capybara-screenshot (1.0.27)
124124
capybara (>= 1.0, < 4)
125125
launchy
126126
childprocess (5.1.0)
@@ -131,7 +131,7 @@ GEM
131131
connection_pool (3.0.2)
132132
crass (1.0.6)
133133
csv (3.3.5)
134-
dalli (4.0.1)
134+
dalli (5.0.2)
135135
logger
136136
date (3.5.1)
137137
declarative (0.0.20)
@@ -156,14 +156,14 @@ GEM
156156
concurrent-ruby (~> 1.0)
157157
dry-core (~> 1.1)
158158
zeitwerk (~> 2.6)
159-
dry-types (1.9.0)
159+
dry-types (1.9.1)
160160
bigdecimal (>= 3.0)
161161
concurrent-ruby (~> 1.0)
162162
dry-core (~> 1.0)
163163
dry-inflector (~> 1.0)
164164
dry-logic (~> 1.4)
165165
zeitwerk (~> 2.6)
166-
erb (6.0.1)
166+
erb (6.0.2)
167167
erubi (1.13.1)
168168
et-orbi (1.4.0)
169169
tzinfo
@@ -178,7 +178,7 @@ GEM
178178
railties (>= 6.1.0)
179179
faker (3.6.0)
180180
i18n (>= 1.8.11, < 2)
181-
faraday (2.14.0)
181+
faraday (2.14.1)
182182
faraday-net_http (>= 2.0, < 3.5)
183183
json
184184
logger
@@ -221,15 +221,15 @@ GEM
221221
base64 (~> 0.2)
222222
faraday (>= 1.0, < 3.a)
223223
google-logging-utils (0.2.0)
224-
googleauth (1.16.1)
224+
googleauth (1.16.2)
225225
faraday (>= 1.0, < 3.a)
226226
google-cloud-env (~> 2.2)
227227
google-logging-utils (~> 0.1)
228228
jwt (>= 1.4, < 4.0)
229229
multi_json (~> 1.11)
230230
os (>= 0.9, < 2.0)
231231
signet (>= 0.16, < 2.a)
232-
grape (3.1.0)
232+
grape (3.1.1)
233233
activesupport (>= 7.1)
234234
dry-configurable
235235
dry-types (>= 1.1)
@@ -239,9 +239,9 @@ GEM
239239
grape-entity (1.0.1)
240240
activesupport (>= 3.0.0)
241241
multi_json (>= 1.3.2)
242-
grape-swagger (2.1.3)
242+
grape-swagger (2.1.4)
243243
grape (>= 1.7, < 4.0)
244-
grape-swagger-entity (0.7.0)
244+
grape-swagger-entity (0.7.1)
245245
grape-entity (~> 1)
246246
grape-swagger (~> 2)
247247
hashie (5.1.0)
@@ -255,12 +255,13 @@ GEM
255255
mini_magick (>= 4.9.5, < 6)
256256
ruby-vips (>= 2.0.17, < 3)
257257
io-console (0.8.2)
258-
irb (1.16.0)
258+
irb (1.17.0)
259259
pp (>= 0.6.0)
260+
prism (>= 1.3.0)
260261
rdoc (>= 4.0.0)
261262
reline (>= 0.4.2)
262263
jmespath (1.6.2)
263-
json (2.18.0)
264+
json (2.18.1)
264265
json-schema (6.1.0)
265266
addressable (~> 2.8)
266267
bigdecimal (>= 3.1, < 5)
@@ -284,12 +285,13 @@ GEM
284285
net-smtp
285286
marcel (1.1.0)
286287
matrix (0.4.3)
287-
mcp (0.6.0)
288+
mcp (0.7.1)
288289
json-schema (>= 4.1)
289290
mini_magick (5.3.1)
290291
logger
291292
mini_mime (1.1.5)
292-
minitest (6.0.1)
293+
minitest (6.0.2)
294+
drb (~> 2.0)
293295
prism (~> 1.5)
294296
multi_json (1.19.1)
295297
multi_xml (0.8.1)
@@ -301,7 +303,7 @@ GEM
301303
mutex_m (0.3.0)
302304
net-http (0.9.1)
303305
uri (>= 0.11.1)
304-
net-imap (0.6.2)
306+
net-imap (0.6.3)
305307
date
306308
net-protocol
307309
net-pop (0.1.2)
@@ -311,11 +313,11 @@ GEM
311313
net-smtp (0.5.1)
312314
net-protocol
313315
nio4r (2.7.5)
314-
nokogiri (1.19.0-arm64-darwin)
316+
nokogiri (1.19.1-arm64-darwin)
315317
racc (~> 1.4)
316-
nokogiri (1.19.0-x86_64-darwin)
318+
nokogiri (1.19.1-x86_64-darwin)
317319
racc (~> 1.4)
318-
nokogiri (1.19.0-x86_64-linux-gnu)
320+
nokogiri (1.19.1-x86_64-linux-gnu)
319321
racc (~> 1.4)
320322
oauth (1.1.3)
321323
base64 (~> 0.1)
@@ -336,7 +338,7 @@ GEM
336338
ostruct (0.6.3)
337339
package_json (0.2.0)
338340
parallel (1.27.0)
339-
parser (3.3.10.1)
341+
parser (3.3.10.2)
340342
ast (~> 2.4.1)
341343
racc
342344
pg (1.6.3-arm64-darwin)
@@ -348,8 +350,8 @@ GEM
348350
pp (0.6.3)
349351
prettyprint
350352
prettyprint (0.2.0)
351-
prism (1.8.0)
352-
pstore (0.2.0)
353+
prism (1.9.0)
354+
pstore (0.2.1)
353355
psych (5.3.1)
354356
date
355357
stringio
@@ -358,7 +360,7 @@ GEM
358360
nio4r (~> 2.0)
359361
raabro (1.4.0)
360362
racc (1.8.1)
361-
rack (3.2.4)
363+
rack (3.2.5)
362364
rack-cors (3.0.0)
363365
logger
364366
rack (>= 3.0.14)
@@ -389,8 +391,8 @@ GEM
389391
activesupport (>= 5.0.0)
390392
minitest
391393
nokogiri (>= 1.6)
392-
rails-html-sanitizer (1.6.2)
393-
loofah (~> 2.21)
394+
rails-html-sanitizer (1.7.0)
395+
loofah (~> 2.25)
394396
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
395397
railties (8.1.2)
396398
actionpack (= 8.1.2)
@@ -403,18 +405,18 @@ GEM
403405
zeitwerk (~> 2.6)
404406
rainbow (3.1.1)
405407
rake (13.3.1)
406-
rdoc (7.1.0)
408+
rdoc (7.2.0)
407409
erb
408410
psych (>= 4.0.0)
409411
tsort
410-
react_on_rails (16.2.1)
412+
react_on_rails (16.3.0)
411413
addressable
412414
connection_pool
413415
execjs (~> 2.5)
414416
rails (>= 5.2)
415417
rainbow (~> 3.0)
416418
shakapacker (>= 6.0)
417-
redis-client (0.26.3)
419+
redis-client (0.26.4)
418420
connection_pool
419421
regexp_parser (2.11.3)
420422
reline (0.6.3)
@@ -423,34 +425,35 @@ GEM
423425
declarative (< 0.1.0)
424426
trailblazer-option (>= 0.1.1, < 0.2.0)
425427
uber (< 0.2.0)
426-
retriable (3.1.2)
428+
retriable (3.2.1)
427429
rexml (3.4.4)
428430
rspec-core (3.13.6)
429431
rspec-support (~> 3.13.0)
430432
rspec-expectations (3.13.5)
431433
diff-lcs (>= 1.2.0, < 2.0)
432434
rspec-support (~> 3.13.0)
433-
rspec-mocks (3.13.7)
435+
rspec-mocks (3.13.8)
434436
diff-lcs (>= 1.2.0, < 2.0)
435437
rspec-support (~> 3.13.0)
436-
rspec-rails (8.0.2)
438+
rspec-rails (8.0.3)
437439
actionpack (>= 7.2)
438440
activesupport (>= 7.2)
439441
railties (>= 7.2)
440442
rspec-core (~> 3.13)
441443
rspec-expectations (~> 3.13)
442444
rspec-mocks (~> 3.13)
443445
rspec-support (~> 3.13)
444-
rspec-support (3.13.6)
445-
rubocop (1.82.1)
446+
rspec-support (3.13.7)
447+
rubocop (1.85.0)
446448
json (~> 2.3)
447449
language_server-protocol (~> 3.17.0.2)
448450
lint_roller (~> 1.1.0)
451+
mcp (~> 0.6)
449452
parallel (~> 1.10)
450453
parser (>= 3.3.0.2)
451454
rainbow (>= 2.2.2, < 4.0)
452455
regexp_parser (>= 2.9.3, < 3.0)
453-
rubocop-ast (>= 1.48.0, < 2.0)
456+
rubocop-ast (>= 1.49.0, < 2.0)
454457
ruby-progressbar (~> 1.7)
455458
unicode-display_width (>= 2.4.0, < 4.0)
456459
rubocop-ast (1.49.0)
@@ -497,19 +500,20 @@ GEM
497500
rufus-scheduler (3.9.2)
498501
fugit (~> 1.1, >= 1.11.1)
499502
securerandom (0.4.1)
500-
selenium-webdriver (4.40.0)
503+
selenium-webdriver (4.41.0)
501504
base64 (~> 0.2)
502505
logger (~> 1.4)
503506
rexml (~> 3.2, >= 3.2.5)
504507
rubyzip (>= 1.2.2, < 4.0)
505508
websocket (~> 1.0)
506-
semantic_range (3.1.0)
507-
sentry-rails (6.3.0)
509+
semantic_range (3.1.1)
510+
sentry-rails (6.4.0)
508511
railties (>= 5.2.0)
509-
sentry-ruby (~> 6.3.0)
510-
sentry-ruby (6.3.0)
512+
sentry-ruby (~> 6.4.0)
513+
sentry-ruby (6.4.0)
511514
bigdecimal
512515
concurrent-ruby (~> 1.0, >= 1.0.2)
516+
logger
513517
shakapacker (9.5.0)
514518
activesupport (>= 5.2)
515519
package_json
@@ -518,7 +522,7 @@ GEM
518522
semantic_range (>= 2.3.0)
519523
shoulda-matchers (7.0.1)
520524
activesupport (>= 7.1)
521-
sidekiq (8.1.0)
525+
sidekiq (8.1.1)
522526
connection_pool (>= 3.0.0)
523527
json (>= 2.16.0)
524528
logger (>= 1.7.0)
@@ -577,7 +581,7 @@ GEM
577581
will_paginate (4.0.1)
578582
xpath (3.2.0)
579583
nokogiri (~> 1.8)
580-
zeitwerk (2.7.4)
584+
zeitwerk (2.7.5)
581585

582586
PLATFORMS
583587
arm64-darwin-24

app/javascript/components/Search.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const Search = () => {
2020
if (!submittedTerm) return null;
2121

2222
setIsSearching(true);
23-
const response = await authFetch(`/api/v2/search/${submittedTerm}?scope=${scope}&audio_status=${audioStatusFilter}`);
23+
const response = await authFetch(`/api/v2/search/${encodeURIComponent(submittedTerm)}?scope=${scope}&audio_status=${audioStatusFilter}`);
2424
const data = await response.json();
2525
setIsSearching(false);
2626
return data;
@@ -46,7 +46,7 @@ const Search = () => {
4646

4747
setIsSearching(true);
4848
try {
49-
const response = await authFetch(`/api/v2/search/${searchTerm}?scope=${searchScope}&audio_status=complete_or_partial`);
49+
const response = await authFetch(`/api/v2/search/${encodeURIComponent(searchTerm)}?scope=${searchScope}&audio_status=complete_or_partial`);
5050
const data = await response.json();
5151
setResults(data);
5252
} catch (error) {

app/javascript/components/layout/Navbar.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const Navbar = ({ user, handleLogout }) => {
4646
const handleSearchSubmit = (e) => {
4747
e.preventDefault();
4848
if (searchTerm) {
49-
navigate(`/search?term=${searchTerm}`);
49+
navigate(`/search?term=${encodeURIComponent(searchTerm)}`);
5050
closeMenus();
5151
}
5252
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"react-dom": "^18.3.1",
3333
"react-helmet-async": "^2.0.5",
3434
"react-modal": "^3.16.1",
35-
"react-on-rails": "16.2.1",
35+
"react-on-rails": "16.3.0",
3636
"react-paginate": "^8.2.0",
3737
"react-router": "^7.1.1",
3838
"react-spinners": "^0.14.1",

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4543,10 +4543,10 @@ react-modal@^3.16.1:
45434543
react-lifecycles-compat "^3.0.0"
45444544
warning "^4.0.3"
45454545

4546-
react-on-rails@16.2.1:
4547-
version "16.2.1"
4548-
resolved "https://registry.yarnpkg.com/react-on-rails/-/react-on-rails-16.2.1.tgz#174874739e5891676414e110bf02a8a92b138761"
4549-
integrity sha512-47hZ5y69sU6H8RK8H0RDBvBnl4N314DibxsmRVtFIKeoIvvd6nlPyNCqp54jgNehB/mA15VG2H7EeVMHL0u8kA==
4546+
react-on-rails@16.3.0:
4547+
version "16.3.0"
4548+
resolved "https://registry.yarnpkg.com/react-on-rails/-/react-on-rails-16.3.0.tgz#be787eba16df1b45a5d93a444fbdaef26807900f"
4549+
integrity sha512-vMBniBBldXt/a85jyv9FZAG4xkxrLBBuA1Sr3751/bozskrVgOMX7tKy9yoyLuFy6cv8O+tHsPadXK4K5MtD+Q==
45504550

45514551
react-paginate@^8.2.0:
45524552
version "8.3.0"

0 commit comments

Comments
 (0)