pike.git / module.pmod.in

version» Context lines:

pike.git/module.pmod.in:35:   //! }   //! @endcode   class Compiler   {    //! @ignore    inherit Tools@module@.Api;    //! @endignore       //! If a Sass file is importing an external URI this flag determines if    //! thats allowed at all, or if the content type of the imported file has -  //! to be text/scss or if anything goes. Default is @[HTTP_IMPORT_NONE]. +  //! to be in @[http_import_allow_ct], or if anything goes. +  //! Default is @[HTTP_IMPORT_NONE].    //!    //! @seealso    //! @[HTTP_IMPORT_NONE], @[HTTP_IMPORT_GREEDY] and    //! @[HTTP_IMPORT_ANY].    public int(0..2) http_import = HTTP_IMPORT_NONE;       -  +  //! List of allowed content types if @[http_import] is set to +  //! @[HTTP_IMPORT_GREEDY]. The default is to allow @tt{text/scss@} and +  //! @tt{text/sass@}. +  public multiset(string) http_import_allow_ct = +  (< "text/scss", "text/sass" >); +     //! Should file access be tested right away when paths are set or should that    //! be left to Sass to handle? The default value is @tt{true@}.    public bool check_file_access = true;          //! @ignore    protected void create()    {    ::__set_importer_callback(__resolve_import);    }
pike.git/module.pmod.in:75:    if (catch (uri = Standards.URI(path))) {    return UNDEFINED;    }       if (http_import == HTTP_IMPORT_NONE) {    error("Imports over HTTP not allowed!\n");    }       Protocols.HTTP.Query q = Protocols.HTTP.get_url(uri);    -  if (q->status != 200) { +  if (q->status / 100 != 2) {    error("Bad HTTP status (%d) for @import %q!\n",    q->status, (string) uri);    }       array(string) ct_parts = map(q->headers["content-type"]/";",    String.trim_all_whites);       if (http_import == HTTP_IMPORT_GREEDY) { -  if (ct_parts[0] != "text/scss") { +  if (!http_import_allow_ct[ct_parts[0]]) {    error("Returned content type from import (%s) was %q. " -  "Expected \"text/scss\"!\n", -  uri, ct_parts[0]); +  "Expected %s!\n", uri, ct_parts[0], +  String.implode_nicely((array)http_import_allow_ct, "or"));    }    }       string(8bit) data = q->data();       if (sizeof(ct_parts) > 1) {    sscanf(ct_parts[1], "%*s=%s", string charset);    // In case of charset="utf-8" or charset='utf-8', remove the "fnutts"    if (charset && charset[0] < 65) {    charset = charset[1..<1];