6

After your content type line, try adding another \r\n to finish up.


2

Since :( Requesting /test/ outputs /test/index.html is the only index test that fails and index.html is one byte longer than index.php you might first verify that the variable you declare and allocate for your return value is allocated properly. All things being equal, the only 405 in server is the one you added to parse. The difference between a curl ...


2

https://en.m.wikipedia.org/wiki/Web_server A web server is server software, or hardware dedicated to running said software, that can satisfy World Wide Web client requests. A web server can, in general, contain one or more websites. A web server processes incoming network requests over HTTP and several other related protocols. As David Malan says that web ...


2

Well, here is the thing: I don't think you really have to allocate memory on the heap at all. Besides, you are never making use of the allocated memory and it is not recommended per the pset specification page. Let's see how you are never making use of it by looking at a relatively simpler example int i = 10; i = 20; The first statement creates an int ...


1

I'm not at all clear why this matters, but try moving # Configure CS50 Library to use SQLite database db = SQL("sqlite:///formula.db") to the line below Session(app) When I did that with your code, the error went away. (I had a bunch of others related to not having your files, etc, but the werkszeug cache error didn't appear.)


1

check50 doesn't check the form. Same for the similarities/more version. There should have been an error message, and I have no idea why there wasn't (other than a generic "you're sending garbage I don't understand"). So I can tell you what you obviously did wrong and hope it fixes the issue. If you open application.py and read function compare, there are ...


1

If the fifth character of line is equal to ' ', return error?


1

Ah the magic of television :). Assuming your workspace is private, which is the default, your "actual behavior" is the "expected behavior". It is not recommended viz. the Honor Code, but you can change your workspace from private to public in the dashboard. CS50 IDE > Go To Your Dashboard. Here's some doc from cloud9 on the subject of private vs. public.


1

I'm not sure that this is the whole problem, or even related, but something jumped out at me very quickly. Look at the following from line 4 of lookup(): const char* type = NULL; This creates a pointer to a char type and sets it to NULL, meaning that there is no space allocated to it. You later try to assign a string to it, but there's nowhere to put ...


1

I think while nice to be able to read and understand the whole code, you shouldn't necessarily comprehend it all, what is needed in pset6 is to be able to write correctly the functions required.


1

Response to edit#1: NB: The code post turned char* html = malloc(12); into this char html = malloc(12); which was only confusing for a little while :) A major problem you are encountering is your use of strcat. I think you are encountering the segfault right here: path1 = strcat((char*)path, php); At least in the context of this class, you should ...


1

Found the bug which has to do with needle and haystack. Needle and haystack give different values on the browser than when in the command-line and hence, "method" isn't "GET". Hence, while it works on the command-line, it doesn't on the browser. Solved it by using the given variable "line" rather than assigning the variable "entireline".


1

Solved! cat.jpg displaying without extraneous text. Problem had to do with placement of "write" statement. Also, apparently had to add another "\r\n" line.


Only top voted, non community-wiki answers of a minimum length are eligible