並び順

ブックマーク数

期間指定

  • から
  • まで

81 - 113 件 / 113件

新着順 人気順

content-typeの検索結果81 - 113 件 / 113件

  • 特定の文字列を保存したファイルをPHPのmime_content_typeで判定すると実行ファイルとして認識される問題について

    PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

      特定の文字列を保存したファイルをPHPのmime_content_typeで判定すると実行ファイルとして認識される問題について
    • Amplifyでセキュリティヘッダ(Strict-Transport-Security, X-Frame-Options, X-XSS-Protection, X-Content-Type-Options, Content-Security-Policy)を追加する - Qiita

      Amplifyでセキュリティヘッダ(Strict-Transport-Security, X-Frame-Options, X-XSS-Protection, X-Content-Type-Options, Content-Security-Policy)を追加するAWSCloudFrontamplifyAmplifyConsole Amplifyでセキュリティ対策(カスタムヘッダを追加)した際のメモです。 CloudFrontよりお手軽に設定できます。 方法 以下2点のいずれかの方法で設定しましょう。 設定ファイル追加(customHttp.yml) Amplify Console 1. 設定ファイル追加(customHttp.yml) レポジトリのルートディレクトリにcustomHttp.ymlファイルを追加し、commit & push します。 Amplify Consoleでのデ

        Amplifyでセキュリティヘッダ(Strict-Transport-Security, X-Frame-Options, X-XSS-Protection, X-Content-Type-Options, Content-Security-Policy)を追加する - Qiita
      • Content Type Bliss - haskell-servant

        Recently I came across Timo von Holtz’s servant-JuicyPixels package. It describes servant-compatible content-types for JuicyPixel’s DynamicImage data type, and clocks under 100 airy lines. Timo and I realized there is a pretty neat demonstration of the advantage of abstracting away content-type serialization and deserialization: the world’s most concise image-conversion web service. Essentially th

        • IEでPaperclipのvalidates_attachment_content_type が失敗する。 - このブログは証明できない。

          Rails 3でファイルアップロード機能を超かんたんに実装できるPaperclipというプラグイン。 Rails 3 + Paperclipで画像サイズを指定すると、裏でRMagickが動いてる。 - このブログは証明できない。 バリデーション用のメソッドを持っています。バリバリです。 validates_attachment_content_type :image, :content_type => %w( image/jpeg mage/png image/gif ) ところが、IEでJPEGファイルをアップロードすると、上記のバリデーションに引っかかってしまいます。なんか、image/pjpegとかimage/x-pngとかも含めないとダメらしいです。 validates_attachment_content_type :image, :content_type => %w( ima

          • AWS S3にアップロードしたファイルのContent-Typeを一括で書き換えるワンライナー - Qiita

            問題 API 経由でのファイルアップロード処理の実装にミスるなどして、ファイルの Content-Type が binary/octet-stream になってしまって困ることがある。(あまりない) 解決策 aws cli を使ったワンライナーで以下のように書ける。 以下は、.jpg なファイル名のファイルに対して、image/jpeg を設定して回るサンプル。 $ aws s3 ls --recursive s3://<bucket_name>/<somewhere> | grep -e '.jpg$' | awk '{ print "s3://<bucket_name>/"$4 }' | while read origname; do aws s3 mv ${origname} ${origname}.bak; aws s3 mv ${origname}.bak ${origname}

              AWS S3にアップロードしたファイルのContent-Typeを一括で書き換えるワンライナー - Qiita
            • RSSのContent-Type | muzin

              RSSのContent-Typeはどうなっているのか、主要なサイト(自分にとって笑)のRSSのヘッダを読み込んで、Content-Typeを調べてみました。 読み方 ・サイト名 ・RSSファイル名 ・Content-Type @IT – アットマーク・アイティ http://www.atmarkit.co.jp/rss/rss.xml Content-Type: text/html; charset=iso-8859-1 GIGAZINE – コクピットから撮影した美麗な写真 http://gigazine.net/index.php?/news/rss_1.0/ Content-Type: text/xml; charset=utf-8 スラッシュドット ジャパン : アレゲなニュースと雑談サイト http://slashdot.jp/slashdotjp.rss Content-Typ

              • MIME AND THE WEB -- THE MIME CONTENT-TYPE 3

                [Up (Contents)] Multipart Internet Mail Extensions (MIME) The following table lists many of the MIME content-types currently in use on the Web, and gives the data type associacted with the MIME type name. There are in some cases more than one MIME type in use for a given data type. The types are divided into the following categories: To make this table easier to use, some types appear unde

                • 京都産業大学/情報サービス/MIME Content-Type 表

                  MIME Content-Type 表 ■ テキスト/ドキュメント 説明 拡張子 MIME Content-Type

                  • php POST送信時の「Content-type not specified assuming application/x-www-form-urlencoded」エラー | プログラミング備忘録

                    phpでフォームを使わずに直接POST送信したら 「Content-type not specified assuming application/x-www-form-urlencoded」 というエラーが出たのでコードを修正した際のメモ。 これはデータ送信する際のheaderが足りない!という内容のエラーらしい。エラー前は↓のような感じでメソッドタイプとデータを渡してPOSTした。 $data =array( 'param1' => $param1, 'param2' => $param2 ); $data = http_build_query($data, "", "&"); $options =array( 'http' =>array( 'method' => 'POST', 'content' => $data ) ); $contents =file_get_contents

                    • content-type-research/XSS.md at master · BlackFan/content-type-research

                      You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

                        content-type-research/XSS.md at master · BlackFan/content-type-research
                      • JavaScript axios Content-Type の設定にはハマる - かもメモ

                        axios で express のAPI にリクエストを投げていて何故かうまく値が取れなくてハマってしまったのでメモ。 Express のAPI const express = require('express'); const app = express(); const Joi = require('@hapi/joi'); const validation = (data) => { const schema = Joi.object({ email: Joi.string().required().email(), password: Joi.string().min(6).required(), }); return schema.validate(data, { abortEarly: false }); }; app.post('/api/login', (req, res)

                          JavaScript axios Content-Type の設定にはハマる - かもメモ
                        • Rails4 で response.headers['content-type'] - seratch's weblog in Japanese

                          最近 ruby-openid に付属している example の Rails3 アプリをベースに実装を始め、Rails4 にバージョンアップ、微妙な実装箇所を直したり、SReg ではなく AX に対応させるよう修正・・とやっているうちに気がつくとほぼ全部書き換えていた・・!というオチになった私なのですが、その中でも既存の実装を活かし続けていたところでちょっとハマったのでエピソードとして。 response.headers['content-type'] = 'application/xrds+xml' render :text => yadis これだと Content-Type が application/xrds+xml に設定されずに text/html だとかになってしまう。正しくはこう。 response.headers['Content-Type'] = 'applicatio

                            Rails4 で response.headers['content-type'] - seratch's weblog in Japanese
                          • header("Content-Type:text/html;charset=UTF-8");でWarningになる理由と対処方法を知りた... - Yahoo!知恵袋

                            header("Content-Type: text/html; charset=UTF-8");でWarningになる理由と対処方法を知りたいです。 header("Content-Type: text/html; charset=UTF-8");でWarningになる理由と対処方法を知りたいです。 PHPを勉強し始めたのですが、どんなフリーのスクリプトを使っても必ず 「Warning: Cannot modify header information - headers already sent by (output started at /home/***/www/) 」とエラーが出ます。原因は「header("Content-Type: text/html; charset=UTF-8");」のようで、いつもコメントアウトするか「@」などを頭に入れてエラーを消してます。 サーバーは

                              header("Content-Type:text/html;charset=UTF-8");でWarningになる理由と対処方法を知りた... - Yahoo!知恵袋
                            • node.jsでContent-Type指定する際のメモ - HEYBlog about Technology

                              ただ、リクエストに対して、ただ、画像を返すやつ書いてたのに、一瞬詰まった。 var express = require('express'); var router = express.Router(); var fs = require('fs'); /* GET images listing. */ router.get('/', function(req, res) { image_path = req.originalUrl.slice(1); var buf = fs.readFileSync(image_path); res.send(buf, { 'Content-Type': 'image/png' }, 200); }); module.exports = router; localhost:3000/123456abcabc3333123456abcabc3333.pn

                                node.jsでContent-Type指定する際のメモ - HEYBlog about Technology
                              • LispのS式をHTTPでPOSTするときに使うContent-Type – ログ取得ツール

                                表題の通りのどうでもいい話だが、S式のContent-Typeってどうすればいいのかな。ぐぐってもS式をPOSTしている人が世の中では少数派のようだった。なんでだろう。不思議だ。 有力候補はこの2つかな。 application/x-s-expression text/x-s-expression

                                • MIME Content-Type 表

                                  • X-Content-Type-Options: nosniff

                                    X-Content-Type-Options: nosniff つかわないやつは死ねばいいのに! - 葉っぱ日記 http://d.hatena.ne.jp/hasegawayosuke/20110106/p1 hasegawaさんが書いてくれた。もうこのまとめ要らない

                                      X-Content-Type-Options: nosniff
                                    • How to set the Content-Type header for an HttpClient request?

                                      I'm trying to set the Content-Type header of an HttpClient object as required by an API I am calling. I tried setting the Content-Type like below: using (var httpClient = new HttpClient()) { httpClient.BaseAddress = new Uri("http://example.com/"); httpClient.DefaultRequestHeaders.Add("Accept", "application/json"); httpClient.DefaultRequestHeaders.Add("Content-Type", "application/json"); // ... } I

                                        How to set the Content-Type header for an HttpClient request?
                                      • HTTP レスポンスヘッダの Content-Type に現れる charset - やた@はてな日記

                                        BeautifulSoup の文字コード判定が HTTP レスポンスヘッダを使っていないことに思い至って,50 万件くらいのウェブページから,HTTP レスポンスヘッダの Content-Type に指定されている charset(いわゆる文字コード)を抜き出してみました. 結果は以下の通りです.1 列目が頻度,2 列目が charset(小文字に統一),3 列目が IANA の Character Sets(http://www.iana.org/assignments/character-sets)に含まれているかどうか,4 列目が iconv -l(Ubuntu 同梱版)に含まれているかどうかを示しています. Frequency Charset IANA iconv 102076 utf-8 ok ok 52691 euc-jp ok ok 32933 shift_jis ok ok

                                          HTTP レスポンスヘッダの Content-Type に現れる charset - やた@はてな日記
                                        • auはContent-Typeのヘッダの間違いに厳しい? - F.Ko-Jiの「一秒後は未来」

                                          先ほどの「携帯サイトをUTF-8で出力するかShift_JISで出力するか」の続きというかそれ以前の話。 auで「文字化け」の問題が発生する以前に、「『リクエストされたページは表示できません』と出て表示できないよ」と言われました。 ドコモやソフトバンク端末では表示できていて、さらにauのエミュレータ(現在は公開が停止されているOpenwave SDK6.2K)で見ても特に問題がないので、何が原因なのかさっぱり。 ネットで色々調べてみると、どうもContent-Typeヘッダあたりに間違いがあるときに、「リクエストされたページは表示できません」と出ることがわかりました。アクセスログを見ると確かにアクセスはきています。そこでソースコードをよく調べてみると、 header('Content-Type: application/xhtml+xml charset=' . MOBILE_ENCODI

                                            auはContent-Typeのヘッダの間違いに厳しい? - F.Ko-Jiの「一秒後は未来」
                                          • PHPのプログラムで <?php header('Content-type: text/plain; charset=utf-8'); echo "サンプル"; echo "sample"; ?…

                                            PHPのプログラムで <?php header('Content-type: text/plain; charset=utf-8'); echo "サンプル"; echo "sample"; ?> と書いてsample.phpで保存し、ブラウザから「http://documentroot/sample.php」でアクセスすると マルチバイトの文字が「???????」と表示されてしまいます。 このときファイルの文字コードもutf-8にしています。 マルチバイト文字でなければ、「sample」などは正しく表示されます。 なぜ「?????」になっていまうのでしょうか。 Apacheやサーバーなどの設定で正しく表示させる設定方法がありましたら教えてください。

                                            • Content-Type | MDN

                                              HTTP ガイド リソースと URI ウェブ上のリソースの識別 データ URL MIME タイプ入門 よくある MIME タイプ www 付きと www なしの URL の選択 HTTP ガイド HTTP の基本 HTTP の概要 HTTP の進化 HTTP メッセージ 典型的な HTTP セッション HTTP/1.x のコネクション管理 プロトコルのアップグレードの仕組み HTTP セキュリティ Content Security Policy (CSP) HTTP Strict Transport Security (HSTS) X-Content-Type-Options X-Frame-Options X-XSS-Protection Mozilla web security guidelines Mozilla Observatory HTTP アクセス制御 (CORS) HTTP

                                                Content-Type | MDN
                                              • Block visible for Specific Content Type AND Specific URL | Drupal.org

                                                Drupal Association Board Elections Elections for the At-Large member of the Drupal Association Board are in progress. Ten candidates are standing and you can read more about them and ask questions of each now. I wanted to have a block displayed for a specific content type but also displayed on a number of pages. One solution is to create a Block and choose PHP for visibility settings. The PHP code

                                                • Yahoo!画像検索APIが表示できない画像も返すからjquery.lightbox.jsがうまいこと動いてくれなくなってしまうのでLWP::UAでcontent-typeを見て画像ではなかったらデフォルト画像にリダイレクトさせるようにしてみました - 適当な思いつきで書くブログ

                                                  最近、めっきり寒くなってきましたね。 私ごとですが先週末にこじらせた風邪が週中にひどくなり、会社を一日お休みさせて頂きました。(今はほぼ完治です 皆様もお体には十分お気をつけください。 Yahoo!画像検索APIが直リンで表示できない画像も返しちゃう Yahoo!画像検索APIはキーワードを渡すとそれに関連する画像URLや掲載ページURLなどを返してくれるAPIです。 Yahoo!画像検索API サンプルURL 結構便利なAPIなのでちょくちょく使わせてもらっていますがちょっと問題がありまして、返ってくる検索結果の中に直リンクだと表示できない(例えばFC2ブログの画像や新聞社サイトの削除済みのページの画像など)も含まれていたりします。 表示できない画像だとjQuery.jsのLightBoxプラグイン jquery.lightbox.jsが動かなくなる jQuery.jsでLightBox

                                                    Yahoo!画像検索APIが表示できない画像も返すからjquery.lightbox.jsがうまいこと動いてくれなくなってしまうのでLWP::UAでcontent-typeを見て画像ではなかったらデフォルト画像にリダイレクトさせるようにしてみました - 適当な思いつきで書くブログ
                                                  • AWS::S3 を使ってS3にアップロードするときにContent-Typeを指定する - @Konboi memo

                                                    はじめに 今回 aws-sdk を使って S3 に動画をアップロードしていました。 アップロードのコードはこんな感じです。 s3 = AWS::S3.new( access_key_id: CarrierWave::AWS_ACCESS_KEY, secret_access_key: CarrierWave::AWS_SECRET_ACCESS_KEY ) bucket = s3.buckets[CarrierWave::BUCKET_NAME] uploader = bucket.objects["upload-path" ] uploader.write(Pathname.new("target file path")) 今回アップロードしたものは、 mp4 と mp4をffmpegで変換した ogv ファイルになります。 それで問題になったのは、上記のコードでアップロードしても、問題

                                                      AWS::S3 を使ってS3にアップロードするときにContent-Typeを指定する - @Konboi memo
                                                    • Tips: goa で Consumes 指定したときはデフォルトの Content-Type タイプが読み込まれなくなるので注意 - 押してダメならふて寝しろ

                                                      goa はデフォルトで json / xml / gob を受け付けてデコードしてくれるようになっているので特に意識することないと思うのですが,'application/x-www-form-urlencoded' とか,独自のデコーダー作りたいときとかには,Consumes 関数を API の中に書いて指定する必要があります. たとえば,application/x-www-form-urlencoded をデコードするようにしたいときは,次のようにします. var _ = API("myapi", func() { Scheme("http") Host("localhost:8080") Consumes("application/x-www-form-urlencoded", func() { // ★ ← こんなかんじ Package("github.com/goadesign/g

                                                        Tips: goa で Consumes 指定したときはデフォルトの Content-Type タイプが読み込まれなくなるので注意 - 押してダメならふて寝しろ
                                                      • GitHub - igorkasyanchuk/active_storage_validations: Do it like => validates :photos, attached: true, content_type: ['image/png', 'image/jpg', 'image/jpeg'], size: { less_than: 500.kilobytes }, limit: { min: 1, max: 3 }, aspect_ratio: :landscape, dimension

                                                        You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

                                                          GitHub - igorkasyanchuk/active_storage_validations: Do it like => validates :photos, attached: true, content_type: ['image/png', 'image/jpg', 'image/jpeg'], size: { less_than: 500.kilobytes }, limit: { min: 1, max: 3 }, aspect_ratio: :landscape, dimension
                                                        • Webサーバー が返すcontent-type 等のヘッダーを表示

                                                          Webサーバーレスポンスのヘッダー表示 Webサーバーにアクセスすると、実際のコンテンツの前にヘッダー情報を送ってきます。 携帯サイトを作る場合はヘッダーに含まれる content-type が重要になりますが、普通にブラウザを操作していても、これを見ることはできませんので、このページで確認してください。

                                                          • RFC 2425: A MIME Content-Type for Directory Information

                                                            Network Working Group T. Howes Request for Comments: 2425 M. Smith Category: Standards Track Netscape Communications Corp. F. Dawson Lotus Development Corporation September 1998 A MIME Content-Type for Directory Information Status of this Memo This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please re

                                                              RFC 2425: A MIME Content-Type for Directory Information
                                                            • FlaskでシンプルにContent-Typeをチェックする(@content_type) - Qiita

                                                              1. はじめに 前回の記事ではflask、cerberus、peeweeを利用したマイクロサービスのコンセプトアプリを作成しました。今回はその際省略したflaskによるContent-Typeのチェック方法について説明します。また、Content-Typeをチェックする関数デコレータの作り方についても紹介したいと思います。 1.1. 今回紹介する@content_type関数デコレータの仕様 flaskのroute()関数デコレータを付与する関数(つまりREST API)に対して付与する 許可するContent-Typeを関数デコレータの引数に指定する HTTPリクエストヘッダのContent-Typeと引数で指定された値を比較する 異なる場合はHTTPステータスの400エラーをレスポンスとして返却する # rest api @app.route('/questions', methods

                                                                FlaskでシンプルにContent-Typeをチェックする(@content_type) - Qiita
                                                              • Rails format.anyのContent-Typeを指定する - 130単位

                                                                例えばAPIとかのレスポンスで、とにかくJSONのみを返すようにしたいとします。 class Api::ProductsController < ApplicationController def index respond_to do |format| format.any { render json: @products } end end end respond_toとformat.anyを組み合わせることで、/api/products.json とかしなくても、/api/products でJSONが返るようになります。 ただ、format.anyだとレスポンスヘッダのContent-Typeが常にtext/htmlになってしまうみたいです。 これをJSONの適切なヘッダapplication/jsonに変えたいとき。 respond_to do |format| response

                                                                • [CloudFront+S3]HTTPレスポンスヘッダのContent-Typeにcharset=UTF-8を指定する | DevelopersIO

                                                                  吉川@広島です。 CloudFront+S3なSPAにLambda@Edge(もしくはCloudFront Functions)でセキュリティに関するレスポンスヘッダを追加する、というのはよくやると思います。 その中で、今回は、 安全なウェブサイトの作り方 - 1.5 クロスサイト・スクリプティング:IPA 独立行政法人 情報処理推進機構 で紹介されている、 HTTPレスポンスヘッダのContent-Typeフィールドに文字コード(charset)を指定する。 に対応してみました。 具体的な危険性は、 HTTPのレスポンスヘッダのContent-Typeフィールドには、「Content-Type: text/html; charset=UTF-8」のように、文字コード(charset)を指定できます。この指定を省略した場合、ブラウザは、文字コードを独自の方法で推定して、推定した文字コードに

                                                                    [CloudFront+S3]HTTPレスポンスヘッダのContent-Typeにcharset=UTF-8を指定する | DevelopersIO
                                                                  • Email::MIME::ContentType が build_content_type と build_content_disposition を提供するようになっていた - その手の平は尻もつかめるさ

                                                                    Perl の話です. metacpan.org Email::MIME::ContentType 1.023 (なお本バージョンは TRIAL Release となっています) 以降から build_content_type と build_content_disposition という関数が追加されています.それぞれ名前の通り Content-Type と Content-Disposition を構築する責務を担っています. テストコードから一部拝借すると, use Email::MIME::ContentType; my $content_type = build_content_type({ type => 'text', subtype => 'plain', attributes => { charset => 'us-ascii' } }); # => 'text/plain

                                                                      Email::MIME::ContentType が build_content_type と build_content_disposition を提供するようになっていた - その手の平は尻もつかめるさ