Skip to content

Commit

Permalink
Merging conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvainhalle committed Jul 20, 2017
2 parents 9b9cf18 + b820cac commit 1f36f90
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
12 changes: 12 additions & 0 deletions Source/Core/src/ca/uqac/lif/jerrydog/RestCallback.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,18 @@ public boolean fire(HttpExchange t)
public Map<String,String> getParameters(HttpExchange t)
{
String data = null;
if (m_ignoreMethod)
{
// Merge parameters from both GET and POST
URI u = t.getRequestURI();
data = u.getQuery();
Map<String,String> params_get = Server.queryToMap(data, Method.GET);
InputStream is_post = t.getRequestBody();
data = Server.streamToString(is_post);
Map<String,String> params_post = Server.queryToMap(data, Method.POST);
params_get.putAll(params_post);
return params_get;
}
if (m_method == Method.GET)
{
// Read GET data
Expand Down
11 changes: 10 additions & 1 deletion Source/Core/src/ca/uqac/lif/jerrydog/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class Server implements HttpHandler
/**
* The version string
*/
protected static final transient String s_versionString = "0.2";
protected static final transient String s_versionString = "0.2.1";

/**
* User-agent string
Expand Down Expand Up @@ -470,6 +470,15 @@ public static String formatDate(Date d)
{
return s_dateFormat.format(d);
}

/**
* Gets the version of this instance of Jerrydog
* @return The version string
*/
public static String getVersionString()
{
return s_versionString;
}

/**
* Main method. Starts an empty server.
Expand Down
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-2017 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 @@ -37,7 +37,7 @@ public void testQueryToMap1()
}

@Test
public void testQueryToMap2()
public void testQueryToMap2a()
{
String query = "p";
Map<String,String> map = Server.queryToMap(query, Method.GET);
Expand Down

0 comments on commit 1f36f90

Please sign in to comment.