Skip to content
Snippets Groups Projects
Commit 3591c8ec authored by Romain Gabet's avatar Romain Gabet :speech_balloon:
Browse files

rararera

parent 8c7d3864
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -8,7 +8,12 @@
#include "client.h"
#include "http_parse.h"
char* rewrite_target(char *target){
char* ret = strchr(target, '?');
char* rep ="";
strncpy(rep,target,atoi(ret)-1);
return rep;
}
char* fgets_or_exit(char * buffer, int size, FILE *fd){
......@@ -79,6 +84,11 @@ int traitementClient(int socket_client){
}else{
send_response(fd, 404, "Not Found", "Not Found");
}
//partie 7
char* absolute_path = rewrite_target(request.target);
fprintf(fd,"test - - - - - - - - \n%s",absolute_path);
fclose(fd);
return 0;
}
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment