Skip to content

Commit 567e92e

Browse files
Merge latest changes from next (#2675)
* build(deps): bump actions/checkout from 6.0.1 to 6.0.2 (#2672) Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.1 to 6.0.2. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@8e8c483...de0fac2) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 6.0.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Manually parse urls (#2674) * test: ✅ fix react native test, removing need for polyfill * refactor: ♻️ update query parameter parsing * remove use of url.search * remove URLSearchParams * Find the earliest occurrence of '/', '?', or '#' to determine the domain boundary * docs: add CHANGELOG entry --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 parents f0d80e4 + fdba07e commit 567e92e

16 files changed

Lines changed: 76 additions & 54 deletions

File tree

.github/workflows/aws-lambda.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
2222
- run: sam --version
2323

24-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
24+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2525

2626
- name: Install Ruby
2727
uses: ruby/setup-ruby@8d27f39a5e7ad39aebbcbd1324f7af020229645c # v1.287.0

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343

4444
steps:
4545
- name: Checkout repository
46-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
46+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4747

4848
# Initializes the CodeQL tools for scanning.
4949
- name: Initialize CodeQL

.github/workflows/pr-diff.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
node-version: 18.x
1515

1616
- name: Checkout base branch
17-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
17+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1818
with:
1919
ref: ${{ github.base_ref }}
2020

@@ -29,7 +29,7 @@ jobs:
2929
cat packages/browser/dist/bugsnag.min.js | gzip | wc -c > .diff/size-before-gzipped
3030
3131
- name: Checkout PR branch
32-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
32+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3333
with:
3434
clean: false
3535

.github/workflows/scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232

3333
steps:
3434
- name: "Checkout code"
35-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
35+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3636
with:
3737
persist-credentials: false
3838

@@ -76,5 +76,5 @@ jobs:
7676
name: "Checksum validation of Gradle Wrappers"
7777
runs-on: ubuntu-latest
7878
steps:
79-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
79+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8080
- uses: gradle/actions/wrapper-validation@f29f5a9d7b09a7c6b29859002d29d24e1674c884 # v5.0.1

.github/workflows/test-electron.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
os: [ ubuntu-latest ]
1515

1616
steps:
17-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
17+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1818
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
1919
with:
2020
node-version: ${{ matrix.node-version }}

.github/workflows/update-dependencies.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2929
REVIEWER: gingerbenw
3030
steps:
31-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
31+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3232
with:
3333
ref: next
3434

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Changed
66

7+
(plugin-network-instrumentation) Manually parse URLs to improve React Native compatibility [#2674](https://github.com/bugsnag/bugsnag-js/pull/2674)
78
Update bugsnag-android to [v6.22.0](https//github.com/bugsnag/bugsnag-android/releases/tag/v6.22.0) [#2656](https://github.com/bugsnag/bugsnag-js/pull/2656)
89
Update bugsnag-cocoa to [v6.35.0](https//github.com/bugsnag/bugsnag-cocoa/releases/tag/v6.35.0) [#2663](https://github.com/bugsnag/bugsnag-js/pull/2663)
910

packages/node/test/notifier.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ describe('node notifier', () => {
44
beforeAll(() => {
55
jest.spyOn(console, 'debug').mockImplementation(() => {})
66
jest.spyOn(console, 'warn').mockImplementation(() => {})
7+
jest.spyOn(console, 'log').mockImplementation(() => {})
78
})
89

910
beforeEach(() => {

packages/plugin-aws-lambda/test/serverless-express.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ let sentEvents
1414
let sentSessions
1515

1616
describe('serverless express', function () {
17+
beforeAll(() => {
18+
jest.spyOn(console, 'debug').mockImplementation(() => {})
19+
})
20+
1721
beforeEach(function () {
1822
sentEvents = []
1923
sentSessions = []

packages/plugin-network-instrumentation/lib/extract-domain.js

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,29 @@
55
*/
66
module.exports = function (url) {
77
try {
8-
const urlObj = new URL(url)
9-
return urlObj.host
8+
const isAbsolute = /^https?:\/\//i.test(url)
9+
if (!isAbsolute) {
10+
return 'unknown'
11+
}
12+
13+
const urlWithoutProtocol = url.replace(/^https?:\/\//i, '')
14+
15+
// Find the earliest occurrence of '/', '?', or '#' to determine the domain boundary
16+
const slashIndex = urlWithoutProtocol.indexOf('/')
17+
const queryIndex = urlWithoutProtocol.indexOf('?')
18+
const hashIndex = urlWithoutProtocol.indexOf('#')
19+
let endIndex = urlWithoutProtocol.length
20+
if (slashIndex !== -1 && slashIndex < endIndex) {
21+
endIndex = slashIndex
22+
}
23+
if (queryIndex !== -1 && queryIndex < endIndex) {
24+
endIndex = queryIndex
25+
}
26+
if (hashIndex !== -1 && hashIndex < endIndex) {
27+
endIndex = hashIndex
28+
}
29+
30+
return urlWithoutProtocol.substring(0, endIndex)
1031
} catch (e) {
1132
return 'unknown'
1233
}

0 commit comments

Comments
 (0)