Branch: Tag:

2018-03-01

2018-03-01 12:07:27 by Henrik Grubbström (Grubba) <grubba@grubba.org>

HTTP: Normalize paths to Unicode NFC.

Fixes some of [WS-200].

2:   // Modified by Francesco Chemolli to add throttling capabilities.   // Copyright © 1996 - 2004, Roxen IS.    - constant cvs_version = "$Id: http.pike,v 1.590 2009/03/21 18:25:14 mast Exp $"; + constant cvs_version = "$Id$";   // #define REQUEST_DEBUG   #define MAGIC_ERROR   
644:    }    else    catch (f = utf8_to_string (f)); +  if (String.width(f) > 8) { +  // Wide, so it might contain combiners. +  // Combine them if they are there. +  f = Unicode.normalize(f, "NFC");    } -  +  }       // Now after charset decode we can add the multipart/form-data    // variables in case they were rfc 2388 correct.
961:   #endif /* DEBUG */    }    misc["new-uri"] = VFS.normalize_path (contents); +  if (String.width(misc["new-uri"]) > 8) { +  misc["new-uri"] = Unicode.normalize(misc["new-uri"], "NFC"); +  }    break;       case "expect":