GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: prevent error with undefined/null headers entries · nativescript-community/https@e19d7b5

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src/https
    • request.android.ts
    • request.ios.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/https/request.android.ts‎

Copy file name to clipboardExpand all lines: src/https/request.android.ts
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,11 @@ export function createRequest(opts: HttpsRequestOptions, useLegacy: boolean = tr
472472
request.url(opts.url);
473473

474474
if (opts.headers) {
475-
Object.keys(opts.headers).forEach((key) => request.addHeader(key, opts.headers[key] as any));
475+
Object.keys(opts.headers).forEach((key) => {
476+
if (opts.headers[key]) {
477+
request.addHeader(key, opts.headers[key] as any);
478+
}
479+
});
476480
}
477481

478482
if (opts.cachePolicy) {
Collapse file

‎src/https/request.ios.ts‎

Copy file name to clipboardExpand all lines: src/https/request.ios.ts
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,11 @@ export function createRequest(opts: HttpsRequestOptions, useLegacy: boolean = tr
370370
if (heads) {
371371
headers = NSMutableDictionary.dictionary();
372372
Object.keys(heads).forEach(
373-
(key) => headers.setValueForKey(heads[key], key)
373+
(key) => {
374+
if (heads[key]) {
375+
headers.setValueForKey(heads[key], key);
376+
}
377+
}
374378
// manager.requestSerializer.setValueForHTTPHeaderField(
375379
// heads[key] as any,
376380
// key

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.