Closed Bug 228510 Opened 21 years ago Closed 21 years ago

Warning ``function getContentTypeFromHeaders does not always return a value'' [xs] in file ``chrome://navigator/content/pageInfo.js'', line 951, character 0.

Categories

(SeaMonkey :: Page Info, defect)

defect
Not set
trivial

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: timeless, Assigned: timeless)

Details

Attachments

(5 obsolete files)

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031208

Warning ``function getContentTypeFromHeaders does not always return a value''
[xs] in file ``chrome://navigator/content/pageInfo.js'', line 951, character 0.
Attachment #137436 - Flags: superreview?(bz-vacation)
Attachment #137436 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 137436 [details] [diff] [review]
(Av1) |return ""|
[Checked in: Comment 4]

sr=bzbarsky, sure
Attachment #137436 - Flags: superreview?(bz-vacation) → superreview+
Comment on attachment 137436 [details] [diff] [review]
(Av1) |return ""|
[Checked in: Comment 4]

...although I would have preferred null, because that's nearer to what it used
to "return".
Attachment #137436 - Flags: review?(neil.parkwaycc.co.uk) → review+
Comment on attachment 137436 [details] [diff] [review]
(Av1) |return ""|
[Checked in: Comment 4]


Check in: { 12/20/2003 20:04	timeless%mozdev.org	1.60 }
Attachment #137436 - Attachment description: return ... → (Av1) |return ""| [Checked in: Comment 4]
Attachment #137436 - Attachment is obsolete: true
As suggested by comment 3, and a little more.
(In fact, replacing Av1 :-<)
Attachment #137793 - Flags: review?(neil.parkwaycc.co.uk)
OS: Windows XP → All
Hardware: PC → All
Summary: Warning ``function getContentTypeFromHeaders does not always return a value'' [xs] in file ``chrome://navigator/content/pageInfo.js'', line 951, character 0. → Warning ``function getContentTypeFromHeaders does not always return a value'' [xs] in file ``chrome://navigator/content/pageInfo.js'', line 951, character 0.
Attachment #137793 - Flags: review?(neil.parkwaycc.co.uk) → review+
Attachment #137793 - Flags: superreview?(bz-vacation)
personally, if you're going to do that i'd change the code to be:

function getContentTypeFromHeaders(cacheEntryDescriptor)
{
  if (!cacheEntryDescriptor)
    return null;

  var headers = cacheEntryDescriptor.getMetaDataElement("response-head");
  var match = /^Content-Type:\s*(.*?)\s*(?:\;|$)/mi.exec(headers);
  return match[1];
}
Attachment #137793 - Attachment is obsolete: true
Attachment #137793 - Flags: superreview?(bz-vacation)
Attachment #137924 - Flags: superreview?(bz-vacation)
Attachment #137924 - Flags: review?(neil.parkwaycc.co.uk)
Attachment #137924 - Attachment description: (Bv1b) |return null|, and var removals → (Bv2) |return null|, and var removals
(My mistake: Bv1b was still Bv1 :-()

Bv1, with comment 6 suggestion.
Attachment #137926 - Flags: superreview?(bz-vacation)
Attachment #137926 - Flags: review?(neil.parkwaycc.co.uk)
Attachment #137924 - Attachment description: (Bv2) |return null|, and var removals → (Bv1b) |return null|, and var removals [== Bv1 :-(]
Attachment #137924 - Attachment is obsolete: true
Attachment #137924 - Flags: superreview?(bz-vacation)
Attachment #137924 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 137926 [details] [diff] [review]
(Bv2) |return null|, and var removals

sr=bzbarsky if you add another set of parens around the whole //.exec()
construction... (I think that will be more readable.)
Attachment #137926 - Flags: superreview?(bz-vacation) → superreview+
Attachment #137926 - Attachment is obsolete: true
Attachment #137926 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 137949 [details] [diff] [review]
(Bv2b) |return null|, and var removals
[Checked in: Comment 12]


(Bv2) 'bz-vacation: superreview+'. (from comment 9)
Attachment #137949 - Flags: superreview+
Attachment #137949 - Flags: review?(neil.parkwaycc.co.uk)
Attachment #137949 - Flags: review?(neil.parkwaycc.co.uk) → review+
Comment on attachment 137949 [details] [diff] [review]
(Bv2b) |return null|, and var removals
[Checked in: Comment 12]


Check in: { 12/25/2003 16:01	neil%parkwaycc.co.uk	1.61 }
Attachment #137949 - Attachment description: (Bv2b) |return null|, and var removals → (Bv2b) |return null|, and var removals [Checked in: Comment 12]
Attachment #137949 - Attachment is obsolete: true
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
[Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.6) Gecko/20040113] (W98SE)

Argh ... This patch(s) is not in v1.6: too bad ;-<
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: