Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 331026

Summary: NullPointerException while getting null Content-Type in http response
Product: z_Archived Reporter: nils.thieme
Component: SmilaAssignee: Project Inbox <smila.irms-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel.stucky, tmenzel
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

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