Changeset 310

Show
Ignore:
Timestamp:
07/12/10 17:07:01 (19 months ago)
Author:
ol
Message:

Udig compliancy session: remove CR/LF from KVP query URL. Add Buggy Udig CONTENT_TYPE for XML query

Location:
trunk/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/ows/ows.c

    r300 r310  
    299299     * Request encoding and HTTP method WFS 1.1.0 -> 6.5 
    300300     */ 
    301  
     301    
    302302    /* GET could only handle KVP */ 
    303303    if (cgi_method_get()) o->request->method = OWS_METHOD_KVP; 
     
    316316                 !strcmp(getenv("CONTENT_TYPE"), "application/xml; charset=UTF-8") || 
    317317                 !strcmp(getenv("CONTENT_TYPE"), "text/plain")) 
     318            o->request->method = OWS_METHOD_XML; 
     319 
     320        /* Udig buggy: to remove a day */ 
     321        else if (!strcmp(getenv("CONTENT_TYPE"), "text/xml, application/xml")) 
    318322            o->request->method = OWS_METHOD_XML; 
    319323 
  • trunk/src/struct/cgi_request.c

    r293 r310  
    145145/* 
    146146 * Transform url's plus into spaces 
    147  * Source : http://hoohoo.ncsa.uiuc.edu/docs/ 
    148147 */ 
    149148static void cgi_plustospace(char *str) 
     
    151150    int x; 
    152151 
    153     for (x = 0; str[x]; x++) 
    154         if (str[x] == '+') 
    155             str[x] = ' '; 
    156 } 
    157  
     152    for (x=0 ; str[x] ; x++) 
     153        if (str[x] == '+') str[x] = ' '; 
     154} 
     155 
     156/* 
     157 * Remove CR or LF in URL  
     158 */ 
     159static void cgi_remove_crlf(char *str) 
     160{ 
     161    int x; 
     162 
     163    for (x=0 ; str[x] ; x++) 
     164        if (str[x] == '\n' || str[x] == '\r') 
     165                str[x] = ' '; 
     166} 
    158167 
    159168/* 
     
    179188 
    180189    cgi_unescape_url(query); 
     190    cgi_remove_crlf(query); 
    181191    cgi_plustospace(query); 
    182192