Skip to content

Commit

Permalink
Bugfix to setting of Content-Type in CallbackResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvainhalle committed Jul 1, 2020
1 parent 15b8ec3 commit 6e78ce7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
11 changes: 3 additions & 8 deletions Source/Core/src/ca/uqac/lif/jerrydog/CallbackResponse.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Jerrydog, a lightweight web application server in Java
Copyright (C) 2015-2016 Sylvain Hallé
Copyright (C) 2015-2020 Sylvain Hallé
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
Expand Down Expand Up @@ -54,11 +54,6 @@ public static enum ContentType {JSON, TEXT, XML, PNG, JS, HTML, CSS, JPEG, PDF,
*/
protected int m_responseCode;

/**
* The response content type
*/
protected String m_contentType;

/**
* The response headers
*/
Expand Down Expand Up @@ -91,7 +86,7 @@ public CallbackResponse(HttpExchange t, int response_code, byte[] contents, Stri
m_responseCode = response_code;
m_contents = contents;
m_headers = new HashMap<String,String>();
m_contentType = content_type;
setContentType(content_type);
}

/**
Expand Down Expand Up @@ -240,7 +235,7 @@ public Map<String,String> getHeaders()
*/
public String getContentType()
{
return m_contentType;
return m_headers.get("Content-Type");
}

/**
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/src/ca/uqac/lif/jerrydog/Server.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Jerrydog, a lightweight web application server in Java
Copyright (C) 2015-2017 Sylvain Hallé
Copyright (C) 2015-2020 Sylvain Hallé
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
Expand Down Expand Up @@ -63,7 +63,7 @@ public class Server implements HttpHandler
/**
* The version string
*/
protected static final transient String s_versionString = "0.3.1";
protected static final transient String s_versionString = "0.3.2";

/**
* User-agent string
Expand Down
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<name>Jerrydog</name>

<!-- The project's version number -->
<version>0.3.1</version>
<version>0.3.2</version>

<!-- The project's author. Currently this only
shows up in the footer of the Javadoc documentation. -->
Expand Down

0 comments on commit 6e78ce7

Please sign in to comment.