Skip to content

Commit

Permalink
chore(route): japanpost: update radar rules (#13198)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuzi3040 authored Sep 3, 2023
1 parent 4b1a103 commit f57c0df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/v2/japanpost/radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
docs: 'https://docs.rsshub.app/routes/other#japanpost-ri-ben-you-bian',
source: '/services/srv/search/direct',
target: (params, url) => {
const reqCode = new URL(url).searchParams.get('reqCodeNo1').toUpperCase();
const reqCode = new URL(url).searchParams.get('reqCodeNo1').replace(/[^0-9a-zA-Z]/g, '').toUpperCase();
const locale = new URL(url).searchParams.get('locale').toLowerCase();
if ((reqCode.search(/^(?:\d{11,12}|[A-Z]{2}\d{9}[A-Z]{2})$/) === 0 && locale === 'ja') || locale === 'en') {
return `/japanpost/track/${reqCode}/${locale}`;
Expand Down

0 comments on commit f57c0df

Please sign in to comment.