Skip to content

Commit

Permalink
🐛 Fix #40
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Jan 12, 2020
1 parent 4e4a138 commit 66478b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
package org.b3log.solo.processor;

import org.b3log.latke.Keys;
import org.b3log.latke.http.RequestContext;
import org.b3log.latke.http.handler.Handler;
import org.b3log.latke.util.Requests;
Expand All @@ -27,13 +28,14 @@
* Before request handler.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.1, Jan 12, 2020
* @version 1.0.0.2, Jan 12, 2020
* @since 3.6.7
*/
public class BeforeRequestHandler implements Handler {

@Override
public void handle(final RequestContext context) {
context.attr(Keys.HttpRequest.START_TIME_MILLIS, System.currentTimeMillis());
final String remoteAddr = Requests.getRemoteAddr(context.getRequest());
if (Solos.BLACKLIST_IPS.contains(remoteAddr)) {
context.setStatus(429);
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/b3log/solo/processor/PermalinkHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* Article permalink handler.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.3, Nov 3, 2019
* @version 1.0.0.4, Jan 12, 2020
* @since 3.2.0
*/
public class PermalinkHandler implements Handler {
Expand Down Expand Up @@ -124,7 +124,6 @@ public void handle(final RequestContext context) {
*
* @param context the specified request context
* @param article the specified article
* @see Dispatcher#rendTODO(RequestContext)
*/
private void dispatchToArticleProcessor(final RequestContext context, final JSONObject article) {
context.attr(Article.ARTICLE, article);
Expand Down

0 comments on commit 66478b7

Please # to comment.