Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 331026 - NullPointerException while getting null Content-Type in http response
Summary: NullPointerException while getting null Content-Type in http response
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Smila (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-24 10:04 EST by nils.thieme CLA
Modified: 2022-07-07 11:31 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nils.thieme CLA 2010-11-24 10:04:11 EST
Some web server doesn't reply with a Content-Type attribute within the http response. In such case a NullPointerException is thrown in line 60 of the org.eclipse.smila.connectivity.framework.crawler.web.parse.ParserManagerImpl class.

There must be check if the response contains a Content-Type attribute.
Comment 1 Daniel Stucky CLA 2010-11-29 08:52:36 EST
Hi Nils,

thanks for your bug report. Could you please provide a sample URL were the webserver does not reply a Content-Type so that I can add a JUnit Test ?

I already added a check if the contentType is null in ParserManagerImpl with revision 713. 

Bye,
Daniel
Comment 2 thomas menzel CLA 2010-12-07 03:37:57 EST
(In reply to comment #1)
> Could you please provide a sample URL were the
> webserver does not reply a Content-Type so that I can add a JUnit Test ?
> 

shouldn't that rather be mocked than having a test against a live URL?
Comment 3 Igor Novakovic CLA 2011-09-21 06:50:37 EDT
I' closing this issue since no further input has been provided and the fix has been committed.
Comment 4 Andreas Weber CLA 2013-04-15 11:48:33 EDT
Closing this