Comments (20)
Thanks. Do you have a reproducer for this?
The easiest thing would be to copy and edit the realtime apex example in the examples repository.
from vertx-web.
I must be wrong with the cause of the 404. The SockJSHandler does not handle only root-paths. The RountingContextWrapper is setting the mountPoint in repsect to the parent mointPoint:
public RoutingContextWrapper(String mountPoint, HttpServerRequest request, Iterator iter,
RoutingContext inner) {
super(mountPoint, request, iter);
this.inner = inner;
String parentMountPoint = inner.mountPoint();
if (mountPoint.charAt(mountPoint.length() - 1) == '/') {
// Remove the trailing slash or we won't match
mountPoint = mountPoint.substring(0, mountPoint.length() - 1);
}
this.mountPoint = parentMountPoint == null ? mountPoint : parentMountPoint + mountPoint; //<- Here the parrent mountPoint gets added to the given mountPoint. So the handler will match for "/nonrootpath/info" in my case.
}
The 404 error disappeares when I remove all of my self-written handlers and when I have only one SockJSHandler registered. Currently I have to investigate why one of my own handlers produces a 404.
from vertx-web.
Ok, I've found the issue within the class RouteImpl. The cause for the 404 was a handler that I have registered on a path with an asterisk * at the end. The problem is that the current implementation of RouteImpl matches more paths than the author likely intented to do.
Regarding the documentation https://github.com/vert-x3/vertx-apex/blob/master/src/main/asciidoc/java/index.adoc the example path "/some/path/*" should be called for any request with a URI path that starts with "/some/path/". But that's not true :-) The trailing-slash will be removed during the path-match-check in the class RouteImpl, line 336, so it will be called for any request with a URI path that starts with "/some/path":
if (exactPath) {
return pathMatchesExact(requestPath, thePath);
} else {
return requestPath.startsWith(removeTrailing(thePath)); <- Here is the cause of matching too much
}
Is the path "/some/path/*" really meant to match "/some/pathfoo/bar.html" and "/some/path.html"?
from vertx-web.
Thanks, once you get a reproducer together, I'll take a look :)
from vertx-web.
Here is a simple Testcase. It can be used to update/added to io.vertx.ext.apex.RouterTest:
https://gist.github.com/leolux/0675612cc442f569faae
from vertx-web.
I like to run all Apex Unit-Tests. Is there any global TestSuite?
from vertx-web.
Not sure what you mean by "global testuite".
If you want to run all Apex tests you can do this in your IDE by right clicking the directory and run as... or from the command line: mvn test
from vertx-web.
Ok, that's even simpler :-)
from vertx-web.
I have some problems running the Apex Unit-Tests. From 381 tests there are 247 failures and 1 error. But I didn't make any changes in the code. How many tests are supposed to fail at the moment?
Do you plan to introduce Gerrit? Using Git in combination with Gerrit would be one way to assure that only those change sets will get merged into the master branch that have passed all tests in Jenkins.
from vertx-web.
Which operating system are you using?
from vertx-web.
Windows 8, Version 6.3 (64 bit)
from vertx-web.
There have been some trouble running on Windows in the past. I have merged a PR that should fix some of the issues. Trouble is non of the core team are Windows users.
Also.. when you clone the GitHub project can you make sure your Git client doesn't convert \n
to \r\n
?
from vertx-web.
You are right. The conversion to CRLF was the problem. So I changed my global config to:
core.autocrlf=false
core.eol=lf
Maybe we should force LF for this repository by adding the file .gitattributes containing the following line
- text eol=lf
from vertx-web.
Not sure we want to convert everything to LF.
I think what is needed is for git to not do any conversions - i.e. just to respect whatever is in the repository and not change the line endings at all.
from vertx-web.
General question: How to propose fixes & unit-tests? I couldn't create a pull request somehow because I seem to have no permission do create a remote/upstream branch.
from vertx-web.
Pull requests are done in the standard fork and pull way:
https://help.github.com/articles/using-pull-requests/
from vertx-web.
Thx. Do you have a code style formatter for eclipse? The default settings do not match the existing formatting.
from vertx-web.
IntelliJ yes, not sure about eclipse
https://github.com/vert-x3/wiki/wiki/Vert.x-code-style-guidelines
But settings should be pretty much default with the exception that we
use two spaces for tabs :)
On 30/03/15 14:08, leolux wrote:
Thx. Do you have a code style formatter for eclipse? The default
settings do not match with the existing formatting.—
Reply to this email directly or view it on GitHub
#73 (comment).
from vertx-web.
I didn't find any plugin, converter or xml for eclipse that reflects existing codestyle from inelliJ. But I found a very similar code formatter from google that works better than the default eclipse formatter for vertx: https://code.google.com/p/google-styleguide/source/browse/trunk/eclipse-java-google-style.xml
from vertx-web.
Here is my PR: #84
The change didn't introduce any error/failure in any unit test.
from vertx-web.
Related Issues (20)
- Upgrade GraphiQL IDE HOT 1
- Deprecate WebClientOptions setTryUseCompression HOT 1
- Deprecate CachingWebClientOptions setTryUseCompression HOT 1
- NPE when computing absoluteURI and host is not passed and forwarded headers are present HOT 5
- MVEL TemplateError: file not found on Windows HOT 1
- WEBCLIENT do not encode URL fully (according to RFC 3986, only query parameters HOT 9
- Replace GraphiQL setup by subrouter creation
- Builders for GraphQL handlers
- Introduce dataobjects and or builders for Vert.x Web handlers HOT 1
- RoutingContext.body() won't be available in 4.4.0? HOT 1
- [Feature] Groovy Template Engine HOT 2
- multipart file upload doesn't work with openapi check
- GraphQLWS: `Complete` message type should check for the presence of the `id` field. HOT 1
- GraphiQLHandler mounted as subrouter HOT 1
- Builders for GraphQL handlers HOT 1
- [vertx-web-openapi-router] Can't add an authentication handler to a route that uses a validator HOT 3
- MVELTemplateEngine bug HOT 4
- Document MVEL limitation regarding file resolution HOT 1
- MVEL regression: failure to declare new variables in the template HOT 1
- Intermittent test failures in Healthcheck tests and StaticHandlerTest HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vertx-web.