Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow no rest mappings to be supplied #116

Open
bdw429s opened this issue Apr 2, 2018 · 4 comments
Open

Allow no rest mappings to be supplied #116

bdw429s opened this issue Apr 2, 2018 · 4 comments

Comments

@bdw429s
Copy link
Member

bdw429s commented Apr 2, 2018

I've had a hacky workaround in place ever since the --servlet-rest-mappings arg was added in:

// Runwar will blow up if there isn't a parameter supplied, so I can't pass an empty string.
if( len( serverInfo.restMappings ) ) {
	args.append( '--servlet-rest-mappings' ).append( serverInfo.restMappings );
} else {
	// This effectively disables it (assuming there's not a real directory or route called "___disabled___") but it's janky
	args.append( '--servlet-rest-mappings' ).append( '___DISABLED___' );
}

I don't recall the error right off, but I'd like to be able to just omit the --servlet-rest-mappings when none are specified (which is the default in CommandBox)

@denuno
Copy link
Member

denuno commented Apr 6, 2018

Looks like I added a value check for that a while back, you can pass it an empty string now I believe.

@bdw429s
Copy link
Member Author

bdw429s commented Apr 7, 2018

@denuno Nope. I just tried it and if I provide an empty string for the rest mapping, then the default rest mappings kick in. I don't want there to be any rest mapping by default unless the user explicitly configures them.

 --servlet-rest-mappings ""
[INFO ] runwar.server: Overriding web.xml rest mappings with [/rest]
[INFO ] runwar.server: Added rest mapping: /rest to CFRestServlet

@denuno
Copy link
Member

denuno commented Apr 7, 2018

Does --servlet-rest-enable not work?

@bdw429s
Copy link
Member Author

bdw429s commented Apr 7, 2018

Nope, that doesn't seem to do it. With this JVM arg in place:

 --servlet-rest-enable false

I see this in the console logs:

[INFO ] runwar.server: Overriding web.xml rest mappings with [/rest]
[INFO ] runwar.server: Added rest mapping: /rest to CFRestServlet

denuno pushed a commit that referenced this issue Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants