yada

mikepjb 2017-09-29T08:03:31.000330Z

when a POST goes wrong and a 500 is returned, is it possible to view a stack trace in the response? Currently I am changing the post to a get because yada will print the stack trace that way

malcolmsparks 2017-09-29T08:05:36.000050Z

Are you accepting html in your request?@

mikepjb 2017-09-29T08:10:01.000157Z

I wasn't! Including --header 'Accept: text/html' shows the stack trace now

mikepjb 2017-09-29T08:10:07.000243Z

thanks @malcolmsparks

macroz 2017-09-29T14:09:35.000315Z

interesting, I can't get route to match with path param like AQMkADU4YmQ0ZDU0LTJkNzUtNGE5MS1hNmIwLTZjNzkyNmVhNGI2NABGAAADgLxKILUg8UycUESZkpzxuQcAX74XcER4HUqZ4ZShQm7AgAAAAgENAAAAX74XcER4HUqZ4ZShQm7AgAABoA7_-QAAAA== but if I remove the last two equal signs it does match

macroz 2017-09-29T14:11:25.000369Z

doesn't matter that it is URL encoded

dominicm 2017-09-29T14:24:07.000634Z

@macroz I think there's a fairly strict regex in place in bidi to reduce the chance of exploits.

macroz 2017-09-29T14:25:53.000033Z

Microsoft Graph API contains IDs like that and this is a DELETE request so makes sense to use a path parameter

macroz 2017-09-29T14:27:29.000097Z

I was reading the source code but yada is a complex piece of machinery

malcolmsparks 2017-09-29T14:31:06.000341Z

@macroz that is because the default bidi regex doesn't match on =, but you can declare the regex explicitly in your path param. See bidi's README

macroz 2017-09-29T14:35:24.000674Z

ok was looking for an answer in yada docs

macroz 2017-09-29T14:35:36.000371Z

if I declare a path parameter with String schema I would expect it accepts all Strings

malcolmsparks 2017-09-29T14:36:04.000348Z

It piggy backs on bidi's path parameter logic

malcolmsparks 2017-09-29T14:37:49.000371Z

All strings? Careful with those injection attacks...

malcolmsparks 2017-09-29T14:38:19.000402Z

But yes, it does seem like something that needs a better solution

macroz 2017-09-29T14:38:49.000577Z

it parses/matches the path so it does have some format, it comes in a Java (/Clojure) String so where is your injection possibility?

malcolmsparks 2017-09-29T14:39:45.000723Z

If you go on to use that string in html output, sql concatenation, etc.

malcolmsparks 2017-09-29T14:40:01.000658Z

Just be careful with inputs from requests

macroz 2017-09-29T14:41:05.000121Z

yes, but that is in my view an altogether different concern that is mostly solved by the other library where you pass the String into, i.e. PreparedStatement

malcolmsparks 2017-09-29T14:41:34.000255Z

Sure. I agree. Just be careful

macroz 2017-09-29T14:41:37.000463Z

yeah

macroz 2017-09-29T14:42:26.000115Z

most libraries these days encode and protect by default

macroz 2017-09-29T14:42:43.000650Z

which is good

malcolmsparks 2017-09-29T14:43:05.000593Z

hiccup v1 is one that doesn't There are others...

macroz 2017-09-29T14:43:30.000046Z

well this is SPA and React does

delitescere 2017-10-09T02:20:02.000064Z

That is no great use if the backend isn't also cleaning input.

macroz 2017-09-29T14:43:59.000405Z

I think I got it to work so thanks for the tip

macroz 2017-09-29T14:44:13.000082Z

this would be useful to mention in the yada side as well

malcolmsparks 2017-09-29T14:44:32.000002Z

Great. Yes I will

dominicm 2017-09-29T14:46:26.000393Z

I agree with @macroz that each component should assume dangerous data as input. However, I also think that it's useful to have bidi provide a little bit of extra protection for 99% of cases.

👍 1