6.0.0-beta1
7/20/25

[#13736] Free/Busy character set information ignored
Summary Free/Busy character set information ignored
Queue Horde Framework Packages
Type Bug
State Resolved
Priority 1. Low
Owners jan (at) horde (dot) org, slusarz (at) horde (dot) org
Requester skhorde (at) smail (dot) inf (dot) fh-bonn-rhein-sieg (dot) de
Created 12/04/2014 (3881 days ago)
Due
Updated 12/05/2014 (3880 days ago)
Assigned 12/04/2014 (3881 days ago)
Resolved 12/05/2014 (3880 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
12/05/2014 11:39:14 AM Jan Schneider Comment #5
State ⇒ Resolved
Reply to this comment
Looks good
12/05/2014 11:38:09 AM Jan Schneider Version ⇒
Queue ⇒ Horde Framework Packages
 
12/04/2014 06:26:11 PM Michael Slusarz Comment #4
Assigned to Jan Schneider
Assigned to Michael Slusarz
State ⇒ Feedback
Reply to this comment
Made getHeader() case-insensitive.

Leaving open for Jan to look at, since he knows Horde_Http code better 
than I do.
12/04/2014 06:25:02 PM Git Commit Comment #3 Reply to this comment
Changes have been made in Git (master):

commit 25a839f2bb73c3ab7eae5d14c9116e4ab7e54814
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Thu Dec 4 11:24:25 2014 -0700

     [mms] Horde_Http_Base_Response#getHeader() is now 
case-insensitive for the header input (Bug #13736).

  framework/Http/lib/Horde/Http/Response/Base.php    |   45 ++++++++++++-------
  .../Http/lib/Horde/Http/Response/Peclhttp.php      |    7 ++-
  .../Http/lib/Horde/Http/Response/Peclhttp2.php     |    7 ++-
  framework/Http/package.xml                         |    4 +-
  4 files changed, 38 insertions(+), 25 deletions(-)

http://github.com/horde/horde/commit/25a839f2bb73c3ab7eae5d14c9116e4ab7e54814
12/04/2014 05:47:23 PM Michael Slusarz Comment #2 Reply to this comment
      * @param string $header  Header name to get ('Content-Type',
      *                        'Content-Length', etc.). This is case 
sensitive.
This is just flat-out wrong, considering that HTTP headers are case 
insensitive.

We have Horde_Support_CaseInsensitiveArray to handle this, for example.
12/04/2014 09:22:16 AM skhorde (at) smail (dot) inf (dot) fh-bonn-rhein-sieg (dot) de Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Free/Busy character set information ignored
Queue ⇒ Kronolith
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
FreeBusy.php uses the Horde Http Client class to retrieve information 
and queries the content type with

lib/FreeBusy.php:188
             if ($response->code == 200 && $data = $response->getBody()) {
                 // Detect the charset of the iCalendar data.
                 $contentType = $response->getHeader('Content-Type');

However, the parameter to getHeader() is case-sensitive _and_ 
lower-case, see below.

Horde_Http_Response_Base:

/**
      * Returns the value of a single response header.
      *
      * @param string $header  Header name to get ('Content-Type',
      *                        'Content-Length', etc.). This is case sensitive.
      *
      * @return string HTTP header value.
      */
     public function getHeader($header)

in function _parseHeaders() line 82

             if (preg_match('|^([\w-]+):\s+(.+)|', $headerLine, $m)) {
                 unset($lastHeader);
                 $headerName = strtolower($m[1]);

====

So either it's a bug in getHeader(), because it does not lower-case 
the header name, or FreeBusy.php need to request the lower-case header 
name and the documentation of getHeader() should reflect it, too.

Saved Queries