Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/main/java/org/jenkinsci/plugins/gogs/GogsWebHook.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ associated documentation files (the "Software"), to deal in the Software without
import net.sf.json.JSONObject;
import org.acegisecurity.context.SecurityContext;
import org.acegisecurity.context.SecurityContextHolder;
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.io.IOUtils;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.nio.charset.Charset;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.logging.Logger;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.Charset;
import org.apache.commons.codec.binary.Hex;

/**
* @author Alexander Verhaar
Expand Down Expand Up @@ -160,7 +160,7 @@ public void doIndex(StaplerRequest req, StaplerResponse rsp) throws IOException

String gSecret = null;
if (gogsSignature==null){
gSecret = jsonObject.getString("secret"); /* Secret provided by Gogs */
gSecret = jsonObject.optString("secret", null); /* Secret provided by Gogs < 0.10.x */
}
else{
try{
Expand Down