Routing to a URL behaves differently in config - spring-cloud

I am attempting to get familiar with spring-cloud-gateway and I am having a problem configuring routes in YAML. I am attempting to do a simple redirect based on path to httpbin.org. This works fine when I do this in code but when I am attempting this in YAML config I get a 404.
YAML:
- id: demo
uri: http://httpbin.org
predicates:
- Path=/demo
When I attempt this route, it looks like the route is getting matched- I dont see a 404 for the route itself. What I get in the response is
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try
again.</p>
What am I doing wrong here?

Related

Apache WebDAV to Accept POST as a PUT on New Resource

I have a service that is POSTing to an Apache WebDAV endpoint but POST is not a standard implemented method and on WebDAV.
The end goal is to have files uploaded via a POST to create/overwrite a resource the exact same way a PUT method currently works; as when the service does a PUT, the file is successfully created, but on POST, it only works if a file already exists.
E.g:
Successful PUT on new resource
➜ ~ curl -X PUT -k -F 'data=#test_file_upload.txt https://endpoint.tld/put_test.txt
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>201 Created</title>
</head><body>
<h1>Created</h1>
<p>Resource /put_test.txt has been created.</p>
</body></html>
Unsuccessful POST on new resource
➜ ~ curl -X POST -k -F 'data=#test_file_upload.txt' https://endpoint.tld/post_test.txt
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /post_test.txt was not found on this server.</p>
</body></html>
I have tried Apache Rewrite but cannot change the method.
I am currently attempting to implement a Python3 Flask script with WSGI and a proxy request on POST; but this is becoming incredibly cumbersome and complicated.
Would using mod_perl allow me to script something without extending to a proxied request?
How can I leverage the lowest friction solution to have this working?

Cannot save template constants in typo3

I updated the constants of my template in the web editor of typo3. Each time I click on Save or Close+Save I get a pop-up from my browser to download a file. The content is like this:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>503 Service Unavailable</title>
</head><body>
<h1>Service Unavailable</h1>
<p>The server is temporarily unable to service your
request due to maintenance downtime or capacity
problems. Please try again later.</p>
</body></html>
The minimal example to get this is:
page.theme {
socialmedia.channels {
facebook.url = https://www.facebook.com/typo3/
}
}
It seams that Typo3 has a problem with the dots in the url. If I remove all of them or escape with a backslash "\" everything works. (But the backslash remains in the url and therefore produce invalid urls)
Some months before everything works fine. Some other templates in the same installation have also urls in their configuration and they are working (the page is rendered normaly). If I try to save them noe without any changes I get the same error.
That is the system I use:
Typo3-Version: 9.5.20
Webserver: Apache/2.4.43 (Unix)
PHP-Version: 7.3.21
Database: MySQL 5.6.42
Applicationcontext: Production
OS: SunOS SunOS localhost 5.10 Generic_150401-49 i86pc
Bootstrap Package: 11.0.2

Why is image not loading in jekyll when hosted in github?

I have a blog made using jekyll which is hosted at https://github.com/rocka0/myblog. I wanted to know why my image is not loading in the about me page.
The error for the picture is: Failed to load resource: the server responded with a status of 404 (Not Found).
Set your baseurl to /myblog (no trailing slash) and call your image with
<img itemprop="image" class="img-rounded" src="{{ site.baseurl }}/assets/img/blog-author.jpg" alt="Tush Chen">
From this config, your rocka0/myblog/_config.yml#L3-L4 should be:
# Your website URL (e.g. http://barryclark.github.io or http://www.barryclark.co)
# Used for Sitemap.xml and your RSS feed
url: http://rocka0.github.io/
# If you're hosting your site at a Project repository on GitHub pages
# (http://yourusername.github.io/repository-name)
# and NOT your User repository (http://yourusername.github.io)
# then add in the baseurl here, like this: "/repository-name"
baseurl: "/myblog"
The author image (Geekstatic Facebook avatar of Mario) is square in shape. Everything else is OK. The cases are ok. But when I looked at your config.yml your baseurl is /myblog. Change it back to correct subpath that is /myblog/
Also, check if your url (# the base hostname & protocol for your site) points to http://rocka0.github.io/myblog in config.yml

.NET AdaptivePayment SDK: PaymentDetails() is throwing a ConnectionException (404)

I am calling the AdaptivePaymentService.PaymentDetails() to get the payment details for a payment, and it is throwing a ConnectionException indicating 404. In order to debug the issue, I downloaded the source for the AdaptivePayment SDK as well as the Core SDK and stepped through the code, specifically, right where the HttpRequest is executed in Paypal.HttpConnection.Execute().
It appears as if all configuration variables are being read from the web.config:
The address in the underlying httpRequest looks correct:
The payload looks correct:
However, a WebException is thrown with the following response:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /cgi-bin/ppapi was not found on this server.</p>
<p>Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.</p>
<hr>
<address>Apache Server at api.sandbox.paypal.com Port 443</address>
</body></html>
Any help would be greatly appreciated.
Since you have configured both ClientId/Secret and 3-token credentials (API username, password, signature) in your configuration, the endpoint has been detected incorrectly, giving the REST API higher preference. Please remove the client id / secret configuration and you should see the endpoint set correctly to https://svcs.sandbox.paypal.com/AdaptivePayments/PaymentDetails

servlet filter for url rewriting makes gwt page getting 404

I have a GWT application /application.html
for easy access (and SEO) I would like make url rewriting like /station/fr/foo mapping
I'm trying with a servlet filter declared like this
url-pattern : /station/*
and in this filter, I split parts of the url to build parameters for the target url:
and I do :
request.getRequestDispatcher( targetUrl ).forward( request, response);
But it seems to try accessing /station/Application.html and then 404
[ =========== edited from here =========== ]
Well, know, since this question, I understood a few things: the html page is reached, but tries to load his resources (css, js, img) in /station/
This behaviour is done by the browser (!)
If I had <base href="http://servername/"> it works, but I can't get dev mode working anymore...
Is there's a way to transparently modify on the fly the response to change paths in html source ?
You are looking for fixing the app path in both hosted jetty mode and tomcat/deployment mode to be same - Try https://groups.google.com/d/topic/google-web-toolkit/a8OsRmMSaMg/discussion
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
"http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
<Set name="contextPath">/yourapp</Set>
</Configure>